#41566 [Asn->Csd]: SOAP Server not properly generating href attributes.
| From: | dmitry@php.net | Date: | Thu, 14 Jun 2007 07:10:34 +0000 |
| Subject: | #41566 [Asn->Csd]: SOAP Server not properly generating href attributes. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113760@lists.php.net to get a copy of this message | ||
ID: 41566
Updated by: dmitry@php.net
Reported By: jarismar_silva at adplabs dot com dot br
-Status: Assigned
+Status: Closed
Bug Type: SOAP related
PHP Version: 5.2.3
Assigned To: dmitry
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-06-01 19:57:50] jarismar_silva at adplabs dot com dot br
Description:
------------
SoapServer response xml contains wrong references to node ids.
With PHP 5.2.3 we got this for returned items...
<item xsi:type="ns1:User" id="ref1">
<sName xsi:type="xsd:string">userA</sName>
</item>
<item href="#ref1"/>
<item href="ref1"/> <-- See the missing '#' char
<item href="ref1"/> <-- See the missing '#' char
Manually changing the response xml to include the '#' solves the
problem:
<item xsi:type="ns1:User" id="ref1">
<sName xsi:type="xsd:string">userA</sName>
</item>
<item href="#ref1"/>
<item href="#ref1"/>
<item href="#ref1"/>
Reproduce code:
---------------
To reproduce this problem try to return the same object many times on
any SOAP Service.
/** @return User[] */
function UserSoapService() {
$aUser = new User();
$aUser->sName = 'newUser';
$aUsers = Array();
$aUsers[] = $aUser;
$aUsers[] = $aUser;
$aUsers[] = $aUser;
$aUsers[] = $aUser;
return $aUsers;
}
/* Simple User definition */
Class User {
/** @var string */
public $sName;
}
Expected result:
----------------
Array with 4 times the same user object.
Actual result:
--------------
Exception of class SoapFault
SOAP-ERROR: Encoding: External reference 'ref1'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41566&edit=1