bug38536.phpt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --TEST--
  2. Bug #38536 (SOAP returns an array of values instead of an object)
  3. --EXTENSIONS--
  4. soap
  5. --INI--
  6. soap.wsdl_cache_enabled=0
  7. --FILE--
  8. <?php
  9. class LocalSoapClient extends SoapClient {
  10. function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
  11. return <<<EOF
  12. <?xml version="1.0" encoding="UTF-8"?>
  13. <SOAP-ENV:Envelope
  14. SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  15. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  16. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  17. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  18. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  19. xmlns:ns1="http://www.grupos.com.br/ws/enturma/client">
  20. <SOAP-ENV:Body>
  21. <getClientInfoFromDomainResponse SOAP-ENC:root="1">
  22. <xsd:Result xsi:type="ns1:ClientType">
  23. <id xsi:type="xsd:int">2</id>
  24. <address href="#i2"/>
  25. </xsd:Result>
  26. </getClientInfoFromDomainResponse>
  27. <xsd:address id="i2" xsi:type="ns1:ClientAddressType" SOAP-ENC:root="0">
  28. <idClient xsi:type="xsd:long">2</idClient>
  29. <address href="#i3"/>
  30. </xsd:address>
  31. <address xsi:type="xsd:string" id="i3" SOAP-ENC:root="0">Test</address>
  32. </SOAP-ENV:Body>
  33. </SOAP-ENV:Envelope>
  34. EOF;
  35. }
  36. }
  37. ini_set("soap.wsdl_cache_enabled", 0);
  38. $SOAPObject = new LocalSoapClient(__DIR__.'/bug38536.wsdl');
  39. print_r($SOAPObject->test());
  40. ?>
  41. --EXPECT--
  42. stdClass Object
  43. (
  44. [id] => 2
  45. [address] => stdClass Object
  46. (
  47. [idClient] => 2
  48. [address] => Test
  49. )
  50. )