bug28751.phpt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Bug #28751 (SoapServer does not call _autoload())
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. spl_autoload_register(function ($className) {
  8. class SoapServerActions {
  9. function test() {
  10. return "Hello World";
  11. }
  12. }
  13. });
  14. $server = new SoapServer(NULL, array('uri'=>"http://testuri.org"));
  15. $server->setClass("SoapServerActions");
  16. $HTTP_RAW_POST_DATA = <<<EOF
  17. <?xml version="1.0" encoding="ISO-8859-1"?>
  18. <SOAP-ENV:Envelope
  19. SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  20. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  21. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  22. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  23. xmlns:si="http://soapinterop.org/xsd">
  24. <SOAP-ENV:Body>
  25. <ns1:test xmlns:ns1="http://testuri.org" />
  26. </SOAP-ENV:Body>
  27. </SOAP-ENV:Envelope>
  28. EOF;
  29. $server->handle($HTTP_RAW_POST_DATA);
  30. echo "ok\n";
  31. ?>
  32. --EXPECT--
  33. <?xml version="1.0" encoding="UTF-8"?>
  34. <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>
  35. ok