From: jarismar_silva at adplabs dot com dot br
Operating system:
PHP version: 5.2.3
PHP Bug Type: SOAP related
Bug description: SOAP Server not properly generating href attributes.
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 bug report at http://bugs.php.net/?id=41566&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41566&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41566&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41566&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41566&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41566&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41566&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41566&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41566&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41566&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41566&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41566&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41566&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41566&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41566&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41566&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41566&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41566&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41566&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41566&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41566&r=mysqlcfg