#28321 [Opn->Asn]: Duplicate Tags in SOAP message parsed incorrectly.
| From: | dmitry@php.net | Date: | Fri, 21 May 2004 15:03:48 +0000 |
| Subject: | #28321 [Opn->Asn]: Duplicate Tags in SOAP message parsed incorrectly. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-59845@lists.php.net to get a copy of this message | ||
ID: 28321
Updated by: dmitry@php.net
Reported By: ronunism at hotmail dot com
-Status: Open
+Status: Assigned
Bug Type: SOAP related
Operating System: Fedora Core 1
PHP Version: 5CVS-2004-05-07 (dev)
-Assigned To:
+Assigned To: dmitry
New Comment:
May be the problem in WSDL file?
Can you put here WSDL file, SOAP request (XML) and SOAP response?
Previous Comments:
------------------------------------------------------------------------
[2004-05-07 20:36:10] ronunism at hotmail dot com
Description:
------------
Using PHP5's SoapClient to recieve a SOAP envelope that contains
multiple instances of the same tag, the resulting object retains only
the last item of the given tag name.
E.G. Receiving a SOAP message containing:
<dogs>
<dog>Scooby</dog>
<dog>Lassie</dog>
<dog>Benji</dog>
</dogs>
Results in an object containing:
[dogs] => stdClass Object
(
[dog] => Benji
)
I'm using a perl SOAP::Lite script for the server, and php5's SOAP for
the client. When the tags are changed to be unique (e.g. <dog1>,
<dog2>, <dog3>) all three examples are returned as expected.
Reproduce code:
---------------
[ TestFunction is a simple function that returns a SOAP envelope
containing:
<dogs>
<dog>Scooby</dog>
<dog>Lassie</dog>
<dog>Benji</dog>
</dogs>
$client is the PHP5 SoapClient variable. ]
$test = $client->__call('TestFunction', array($a));
echo '<pre>';
print_r($test);
echo '</pre>';
Expected result:
----------------
stdClass Object
(
[dogs] => array
(
[0] => Scooby
[1] => Lassie
[2] => Benji
)
)
Actual result:
--------------
stdClass Object
(
[dogs] => stdClass Object
(
[dog] => Benji
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28321&edit=1