bug32941.phpt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. Bug #32941 (Sending structured exception kills a php)
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. class TestSoapClient extends SoapClient {
  8. function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
  9. return <<<EOF
  10. <?xml version="1.0" encoding="UTF-8"?>
  11. <soapenv:Envelope
  12. xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  13. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  14. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  15. <soapenv:Body>
  16. <soapenv:Fault>
  17. <faultcode>soapenv:Server.userException</faultcode>
  18. <faultstring>service.EchoServiceException</faultstring>
  19. <detail>
  20. <service.EchoServiceException xsi:type="ns1:EchoServiceException" xmlns:ns1="urn:service.EchoService">
  21. <intParameter xsi:type="xsd:int">105</intParameter>
  22. <parameter xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">string param</parameter>
  23. </service.EchoServiceException>
  24. <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">steckovic</ns2:hostname>
  25. </detail>
  26. </soapenv:Fault>
  27. </soapenv:Body>
  28. </soapenv:Envelope>
  29. EOF;
  30. }
  31. }
  32. ini_set("soap.wsdl_cache_enabled", 1);
  33. $client = new TestSoapClient(__DIR__.'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0));
  34. $ahoj = $client->echoString('exception');
  35. $client = new TestSoapClient(__DIR__.'/bug32941.wsdl', array("trace" => 1, 'exceptions' => 0));
  36. $ahoj = $client->echoString('exception');
  37. echo "ok\n";
  38. ?>
  39. --EXPECT--
  40. ok