bug55323.phpt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. Bug #55323 (SoapClient segmentation fault when XSD_TYPEKIND_EXTENSION contains itself)
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. ini_set("soap.wsdl_cache_enabled",0);
  8. $timestamp = "2011-07-30T03:25:00-05:00";
  9. $wsdl = __DIR__."/bug55323.wsdl";
  10. class TestSoapClient extends SoapClient {
  11. function __construct($wsdl, $options) {
  12. parent::__construct($wsdl, $options);
  13. }
  14. function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
  15. return <<<EOF
  16. <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test.com/soap/v3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
  17. <SOAP-ENV:Body>
  18. <ns1:getObjectResponse>
  19. <getObjectReturn xsi:type="ns1:Customer" id="ref1">
  20. <accountId xsi:type="xsd:int">1234</accountId>
  21. <parent href="#ref1"/>
  22. </getObjectReturn>
  23. </ns1:getObjectResponse>
  24. </SOAP-ENV:Body>
  25. </SOAP-ENV:Envelope>
  26. EOF;
  27. }
  28. }
  29. $soapClient = new TestSoapClient($wsdl,
  30. array('trace' => 1, 'exceptions' => 0));
  31. $result = $soapClient->getObject();
  32. var_dump($result);
  33. ?>
  34. --EXPECTF--
  35. object(stdClass)#%d (2) {
  36. ["accountId"]=>
  37. int(1234)
  38. ["parent"]=>
  39. *RECURSION*
  40. }