Annotation of embedaddon/php/ext/soap/tests/bugs/bug37013.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #37013 (server hangs when returning circular object references)
                      3: --SKIPIF--
                      4: <?php 
                      5:   if (!extension_loaded('soap')) die('skip soap extension not available');
                      6: ?>
                      7: --INI--
                      8: soap.wsdl_cache_enabled=0
                      9: --FILE--
                     10: <?php
                     11: $request = <<<REQUEST
                     12: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
                     13: xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                     14: xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     15: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                     16: 
                     17: <soapenv:Body>
                     18: <ns2:getThingWithParent
                     19:  soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                     20:  xmlns:ns2="urn:test.soapserver#"/>
                     21: </soapenv:Body>
                     22: 
                     23: </soapenv:Envelope>
                     24: REQUEST;
                     25: 
                     26: 
                     27: class ThingWithParent
                     28: {
                     29:  var $parent;
                     30:  var $id;
                     31:  var $children;
                     32:  function __construct( $id, $parent ) {
                     33:   $this->id = $id;
                     34:   $this->parent = $parent;
                     35:  }
                     36: }
                     37: 
                     38: 
                     39: class MultiRefTest {
                     40:  public function getThingWithParent() {
                     41:   $p = new ThingWithParent( 1, null );
                     42:   $p2 = new ThingWithParent( 2, $p );
                     43:   $p3 = new ThingWithParent( 3, $p );
                     44: 
                     45:   $p->children = array( $p2, $p3 );
                     46: 
                     47:   return $p2;
                     48:  }
                     49: }
                     50: 
                     51: 
                     52: $server = new SoapServer(dirname(__FILE__)."/bug37013.wsdl");
                     53: $server->setClass( "MultiRefTest");
                     54: $server->handle( $request );
                     55: ?>
                     56: --EXPECT--
                     57: <?xml version="1.0" encoding="UTF-8"?>
                     58: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test.soapserver#" 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/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getThingWithParentResponse><result id="ref1" xsi:type="SOAP-ENC:Struct"><parent id="ref2" xsi:type="SOAP-ENC:Struct"><parent xsi:nil="true"/><id xsi:type="xsd:int">1</id><children SOAP-ENC:arrayType="SOAP-ENC:Struct[2]" xsi:type="SOAP-ENC:Array"><item href="#ref1"/><item xsi:type="SOAP-ENC:Struct"><parent href="#ref2"/><id xsi:type="xsd:int">3</id><children xsi:nil="true"/></item></children></parent><id xsi:type="xsd:int">2</id><children xsi:nil="true"/></result></ns1:getThingWithParentResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>