Edit report at https://pear.php.net/bugs/bug.php?id=18492&edit=1
ID: 18492
Updated by: daniel.oconnor@gmail.com
Reported By: pub1 at supranetcom dot com
Summary: Wrong response when returning multiple results
-Status: Open
+Status: Closed
Type: Bug
Package: SOAP
Operating System: Windows
Package Version: 0.12.0
PHP Version: 5.3.6
-Assigned To:
+Assigned To: doconnor
Roadmap Versions:
New Comment:
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: doconnor
This bug has been fixed in SVN.
If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should
be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
Previous Comments:
------------------------------------------------------------------------
[2011-04-29 14:11:06] pdp
Added #patch
bug:18492;patch:multiple_results_encapsulation.diff;revision:1304086266;.
------------------------------------------------------------------------
[2011-04-29 14:10:46] pdp
Description:
------------
When a method returns several results, an extra XML level is
added because the result_type is not properly propagated.
In Server.php, function verifyMethod, the $map should also be
set if the object defines a __dispatch_map. If not, the
return_type member will not be set (in verifyMethod), and
buildResult will encapsulate the result in a new SOAP_Value.
Note that this is not visible when using PEAR SOAP client but
appears when using, for example, the built-in SoapClient one.
PEAR SOAP client continues to work after the patch is applied.
Test script:
---------------
doing a addObjectMap on the following object:
class I
{
var $__dispatch_map = array();
//
function I() {
$this->__dispatch_map['F'] =
array ('in' => array('a' => 'string'),
'out' => array('b' => 'string', 'c' => 'string'));
}
//
function F ($a) {
return array ('b', 'c');
}
}
Expected result:
----------------
<?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="http://test.com/"
SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodi
ng/">
<SOAP-ENV:Body>
<ns4:FResponse>
<b xsi:type="xsd:string">B</b>
<c xsi:type="xsd:string">C</c></ns4:FResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Actual result:
--------------
<?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="http://test.com/"
SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodi
ng/">
<SOAP-ENV:Body>
<ns4:FResponse>
<return xsi:type="SOAP-ENC:Array" SOAP-
ENC:arrayType="xsd:string[2]">
<item xsi:type="xsd:string">B</item>
<item xsi:type="xsd:string">C</item></return>
</ns4:FResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------------------------------------------