server014.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. SOAP Server 14: fault
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. function Add($x,$y) {
  8. undefined_function_x();
  9. return $x+$y;
  10. }
  11. $server = new soapserver(null,array('uri'=>"http://testuri.org"));
  12. $server->addfunction("Add");
  13. $HTTP_RAW_POST_DATA = <<<EOF
  14. <?xml version="1.0" encoding="ISO-8859-1"?>
  15. <SOAP-ENV:Envelope
  16. SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  17. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  18. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  19. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  20. xmlns:si="http://soapinterop.org/xsd">
  21. <SOAP-ENV:Body>
  22. <ns1:Add xmlns:ns1="http://testuri.org">
  23. <x xsi:type="xsd:int">22</x>
  24. <y xsi:type="xsd:int">33</y>
  25. </ns1:Add>
  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/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Call to undefined function undefined_function_x()</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
  35. ok