#28321 [Com]: Duplicate Tags in SOAP message parsed incorrectly.
| From: | bramhavers at gmail dot com | Date: | Sat, 20 Sep 2008 09:41:05 +0000 |
| Subject: | #28321 [Com]: Duplicate Tags in SOAP message parsed incorrectly. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-129123@lists.php.net to get a copy of this message | ||
ID: 28321
Comment by: bramhavers at gmail dot com
Reported By: ronunism at hotmail dot com
Status: No Feedback
Bug Type: SOAP related
Operating System: Fedora Core 1
PHP Version: 5CVS-2004-05-07 (dev)
Assigned To: dmitry
New Comment:
Same problem exists for sending the same element multiple times.
See post for problem description:
http://www.zend.com/forums/index.php?t=msg&th=7044&start=0&S=c4426d670fc5fa789e8d7782106c7142
Previous Comments:
------------------------------------------------------------------------
[2008-07-07 11:09:39] iant at clickwt dot com
I have also seen this problem, both in sending and parsing soap
requests. I agree that it seems to be because they are internally stored
as associative arrays, something which is more obvious to the user when
sending requests.
------------------------------------------------------------------------
[2006-02-03 15:48:19] PiRanha_777 at yahoo dot fr
I have the same problem.
I think the problem comes from the fact that, as the SOAP response is
stored in associative arrays, when there are 2 (or more) tags with the
same name the value of the second tag replace the value of first one.
------------------------------------------------------------------------
[2006-01-16 01:22:43] marc dot greenstock at gmail dot com
I am experiencing the same problem with the MSN Search API. More
specifically on the SourceRequest objects, where there are 4 tags of the
same name.
------------------------------------------------------------------------
[2004-05-21 17:03:47] dmitry@php.net
May be the problem in WSDL file?
Can you put here WSDL file, SOAP request (XML) and SOAP response?
------------------------------------------------------------------------
[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