server029.phpt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --TEST--
  2. SOAP Server 29-CGI: new/addfunction/handle
  3. --POST--
  4. <?xml version="1.0" encoding="ISO-8859-1"?>
  5. <SOAP-ENV:Envelope
  6. SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  7. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  8. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  9. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  10. xmlns:si="http://soapinterop.org/xsd">
  11. <SOAP-ENV:Body>
  12. <ns1:test xmlns:ns1="http://testuri.org" />
  13. </SOAP-ENV:Body>
  14. </SOAP-ENV:Envelope>
  15. --EXTENSIONS--
  16. soap
  17. --SKIPIF--
  18. <?php
  19. if (php_sapi_name()=='cli') echo 'skip';
  20. ?>
  21. --FILE--
  22. <?php
  23. echo "INPUT: \n";
  24. echo file_get_contents("php://input") . "\n";
  25. echo "\n\n-----------\n\n";
  26. function test() {
  27. return "Hello World";
  28. }
  29. $server = new soapserver(null,array('uri'=>"http://testuri.org"));
  30. $server->addfunction("test");
  31. $server->handle();
  32. echo "ok\n";
  33. ?>
  34. --EXPECT--
  35. INPUT:
  36. <?xml version="1.0" encoding="ISO-8859-1"?>
  37. <SOAP-ENV:Envelope
  38. SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  39. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  40. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  41. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  42. xmlns:si="http://soapinterop.org/xsd">
  43. <SOAP-ENV:Body>
  44. <ns1:test xmlns:ns1="http://testuri.org" />
  45. </SOAP-ENV:Body>
  46. </SOAP-ENV:Envelope>
  47. -----------
  48. <?xml version="1.0" encoding="UTF-8"?>
  49. <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:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
  50. ok