php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41566 SOAP Server not properly generating href attributes.
Submitted: 2007-06-01 19:57 UTC Modified: 2007-06-14 07:10 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: jarismar_silva at adplabs dot com dot br Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.2.3 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jarismar_silva at adplabs dot com dot br
New email:
PHP Version: OS:

 

 [2007-06-01 19:57 UTC] 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'

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-14 07:10 UTC] dmitry@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 09:01:28 2024 UTC