bug30994.phpt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Bug #30994 (SOAP server unable to handle request with references)
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. $HTTP_RAW_POST_DATA = <<<EOF
  8. <?xml version="1.0" encoding="utf-8"?>
  9. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  10. xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  11. xmlns:tns="http://spock/kunta/kunta"
  12. xmlns:types="http://spock/kunta/kunta/encodedTypes"
  13. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  14. xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  15. <soap:Body
  16. soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  17. <q1:bassCall xmlns:q1="http://spock/bass/types/kunta">
  18. <system xsi:type="xsd:string">XXX</system>
  19. <function xsi:type="xsd:string">TASKTEST</function>
  20. <parameter href="#id1" />
  21. </q1:bassCall>
  22. <soapenc:Array id="id1" soapenc:arrayType="tns:Item[1]">
  23. <Item href="#id2" />
  24. </soapenc:Array>
  25. <tns:Item id="id2" xsi:type="tns:Item">
  26. <key xsi:type="xsd:string">ABCabc123</key>
  27. <val xsi:type="xsd:string">123456</val>
  28. </tns:Item>
  29. </soap:Body>
  30. </soap:Envelope>
  31. EOF;
  32. function bassCall() {
  33. return "ok";
  34. }
  35. $x = new SoapServer(NULL, array("uri"=>"http://spock/kunta/kunta"));
  36. $x->addFunction("bassCall");
  37. $x->handle($HTTP_RAW_POST_DATA);
  38. ?>
  39. --EXPECT--
  40. <?xml version="1.0" encoding="UTF-8"?>
  41. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://spock/kunta/kunta" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:bassCallResponse><return xsi:type="xsd:string">ok</return></ns1:bassCallResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>