php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51165 Using XSD_ANYTYPE removes method response tags in SOAP response
Submitted: 2010-02-27 07:29 UTC Modified: -
Votes:6
Avg. Score:5.0 ± 0.0
Reproduced:6 of 6 (100.0%)
Same Version:5 (83.3%)
Same OS:5 (83.3%)
From: tok at iki dot fi Assigned:
Status: Open Package: SOAP related
PHP Version: 5.2.13 OS: Windows XP
Private report: No CVE-ID: None
 [2010-02-27 07:29 UTC] tok at iki dot fi
Description:
------------
function function1() {
  return new SoapVar("some text",XSD_STRING);
}
function function2() {
  return new SoapVar("<tag>some text</tag>",XSD_ANYXML);
}

$soapserver = new SoapServer("mywsdl.wsdl");
$soapserver->addFunction("function1");
$soapserver->addFunction("function2");
$soapserver->handle();

Requesting function1 will produce

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="myns">
   <SOAP-ENV:Body>
      <ns1:function1Response>some text</ns1:function1Response>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

but requesting function2 will produce

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="myns">
   <SOAP-ENV:Body>
      <tag>some text</tag>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The method name response tags are missing here. The Body-part should be

<ns1:function2Response>
  <tag>some text</tag>
</ns1:function2Response>

Response-tags should come from WSDL as with function1.

This behaviour is also demostrated in http://www.herongyang.com/WSDL/PHP-SOAP-XSD_ANYXML-Build-SOAP-Body-Element.html



Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 16:01:31 2024 UTC