server003.phpt 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. SOAP Server 3: all functions
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. $server = new soapserver(null,array('uri'=>"http://testuri.org"));
  8. $server->addfunction(SOAP_FUNCTIONS_ALL);
  9. $HTTP_RAW_POST_DATA = <<<EOF
  10. <?xml version="1.0" encoding="ISO-8859-1"?>
  11. <SOAP-ENV:Envelope
  12. SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  13. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  14. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  15. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  16. xmlns:si="http://soapinterop.org/xsd">
  17. <SOAP-ENV:Body>
  18. <ns1:strlen xmlns:ns1="http://testuri.org">
  19. <x xsi:type="xsd:string">Hello World</x>
  20. </ns1:strlen>
  21. </SOAP-ENV:Body>
  22. </SOAP-ENV:Envelope>
  23. EOF;
  24. $server->handle($HTTP_RAW_POST_DATA);
  25. echo "ok\n";
  26. ?>
  27. --EXPECT--
  28. <?xml version="1.0" encoding="UTF-8"?>
  29. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" 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:strlenResponse><return xsi:type="xsd:int">11</return></ns1:strlenResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
  30. ok