bug79536.phpt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. --TEST--
  2. Bug #79536 (zend_clear_exception prevent exception's destructor to be called)
  3. --EXTENSIONS--
  4. soap
  5. --INI--
  6. soap.wsdl_cache_enabled=0
  7. --FILE--
  8. <?php
  9. $GLOBALS['HTTP_RAW_POST_DATA']="
  10. <env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
  11. xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
  12. xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
  13. xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
  14. xmlns:ns1=\"http://schemas.nothing.com\"
  15. >
  16. <env:Body>
  17. <ns1:dotest2>
  18. <dotest2 xsi:type=\"xsd:string\">???</dotest2>
  19. </ns1:dotest2>
  20. </env:Body>
  21. <env:Header/>
  22. </env:Envelope>";
  23. class myFault extends SoapFault {
  24. public function __destruct() {
  25. }
  26. }
  27. function book_to_xml($book) {
  28. throw new myFault("Server", "Conversion Fault");
  29. }
  30. class test{
  31. function dotest2($str){
  32. $book = new book;
  33. $book->a = "foo";
  34. $book->b = "bar";
  35. return $book;
  36. }
  37. }
  38. class book{
  39. public $a="a";
  40. public $b="c";
  41. }
  42. $options=Array(
  43. 'actor' =>'http://schemas.nothing.com',
  44. 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
  45. "type_name" => "book",
  46. "to_xml" => "book_to_xml"))
  47. );
  48. $server = new SoapServer(__DIR__."/classmap.wsdl",$options);
  49. $server->setClass("test");
  50. $server->handle($HTTP_RAW_POST_DATA);
  51. echo "ok\n";
  52. ?>
  53. --EXPECT--
  54. <?xml version="1.0" encoding="UTF-8"?>
  55. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Conversion Fault</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
  56. ok