PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » SOAP » Bug #5210

Error in parameters type matching

Details

Submitted2005-08-26 14:51 UTC
Fromnkahn at cmd dot lu
Assignedyunosh
StatusClosed
PackageSOAP
PHP Version4.2.2
OSRed Hat Linux
Roadmaps(Not assigned)

Comments

[2005-08-26 14:51 UTC] nkahn at cmd dot lu

Description:
------------
It seems that parameters type of SOAP message are not evaluated correctly by the SOAP server. For example 'int' parameter are evaluated as 'string'.
The SOAP package version that is used is '0.9.1'.

Test script:
---------------
Tests have been realised using scripts available in "docs" section of SOAP pacakge.
The SOAP server uses "server.php" and "example_server.php".
The SOAP client uses "wsdl_client.php" and "client.php".

Expected result:
----------------
The 'divide' service should have returned the result of the division of the 'dividend' by the 'divisor' but both dividend and divisor are not evaluated properly.

Actual result:
--------------
this is a test string<br>
this is a test string<br>
Error: SOAP request contained mismatching parameters of name dividend had type [string], which did not match signature's type: [int], matched? -10<br>
Error: SOAP request contained mismatching parameters of name dividend had type [string], which did not match signature's type: [int], matched? -10<br>
soap_fault Object
(
[error_message_prefix] =>
[mode] => 1
[level] => 1024
[code] => HTTP
[message] =>
[userinfo] =>
[backtrace] =>
[callback] =>
)
varString: <br>
varInt: 0<br>
varFloat: 0<br>

[2005-08-26 15:46 UTC] nkahn at cmd dot lu

After some investigation the problem seems to be on the client side.
Indeed with PHP5 SOAP client the 'divide' service is working properly as shown below.

REQUEST:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:SOAP_Example_Server" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:divide><dividend xsi:type="xsd:int">10</dividend><divisor xsi:type="xsd:int">5</divisor></ns1:divide></SOAP-ENV:Body></SOAP-ENV:Envelope>

RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:SOAP_Example_Server"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>

<ns4:divideResponse>
<outputFloat xsi:type="xsd:float">2</outputFloat></ns4:divideResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

PEAR::SOAP_Client seems to create wrong SOAP message where information on the paramater type (xsi:type) is missing.
I don't know if we have to use some special options with SOAP_Client. I'll investigate a bit more.
Please help if I miss my point here.
Thanks

[2005-09-01 13:01 UTC] johnk at riceball dot com

I get a similar error. It might be some PHP4 error (or not). The XML request I generated looks like this. The xsi:type="xsd:int" attribute is missing. Haven't figured out why. A quick fix is to delete the the 'in' value in __dispatch_map in your server. Then type checking is not performed.

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:HelloServer"
>
<SOAP-ENV:Body>

<ns4:divide>
<ns4:dividend>22</ns4:dividend>
<ns4:divisor>7</ns4:divisor></ns4:divide>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

[2005-09-01 16:42 UTC] scott at crisscott dot com

I too am experiencing this problem when using the example scripts and PHP 4.3.x. A revert to 0.8.1 allows wsdl_client.php to run properly. (0.9.0 produces the same error as 0.9.1).