bug30175.phpt 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Bug #30175 (SOAP results aren't parsed correctly)
  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. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  15. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  16. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  17. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  18. xmlns:ns1="urn:qweb">
  19. <SOAP-ENV:Body
  20. SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  21. id="_0">
  22. <ns1:HostInfo xsi:type="ns1:HostInfo">
  23. <name xsi:type="xsd:string">blah blah some name field</name>
  24. <shortDescription xsi:type="xsd:string">This is a description. more blah blah blah</shortDescription>
  25. <ipAddress xsi:type="xsd:string">127.0.0.1</ipAddress>
  26. </ns1:HostInfo>
  27. </SOAP-ENV:Body>
  28. </SOAP-ENV:Envelope>
  29. EOF;
  30. }
  31. }
  32. $client = new LocalSoapClient(__DIR__."/bug30175.wsdl");
  33. var_dump($client->qwebGetHostInfo());
  34. ?>
  35. --EXPECT--
  36. array(3) {
  37. ["name"]=>
  38. string(25) "blah blah some name field"
  39. ["shortDescription"]=>
  40. string(42) "This is a description. more blah blah blah"
  41. ["ipAddress"]=>
  42. string(9) "127.0.0.1"
  43. }