{ return <<<EOF <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.grupos.com.br/ws/enturma/client"> <SOAP-ENV:Body> <getClientInfoFromDomainResponse SOAP-ENC:root="1"> <xsd:Result xsi:type="ns1:ClientType"> <id xsi:type="xsd:int">2</id> <address href="#i2"/> </xsd:Result> </getClientInfoFromDomainResponse> <xsd:address id="i2" xsi:type="ns1:ClientAddressType" SOAP-ENC:root="0"> <idClient xsi:type="xsd:long">2</idClient> <address href="#i3"/> </xsd:address> <address xsi:type="xsd:string" id="i3" SOAP-ENC:root="0">Test</address> </SOAP-ENV:Body> </SOAP-ENV:Envelope> EOF; } } ini_set("soap.wsdl_cache_enabled", 0); $SOAPObject = new LocalSoapClient(dirname(__FILE__) . '/bug38536.wsdl'); print_r($SOAPObject->test());
{ public $a = "a"; private $b = "b"; protected $c = "c"; } function test($x) { return $x; } class LocalSoapClient extends SoapClient { function __construct($wsdl, $options) { parent::__construct($wsdl, $options); $this->server = new SoapServer($wsdl, $options); $this->server->addFunction('test'); } function __doRequest($request, $location, $action, $version, $one_way = 0) { ob_start(); $this->server->handle($request); $response = ob_get_contents(); ob_end_clean(); return $response; } } $x = new LocalSoapClient(dirname(__FILE__) . "/bug30928.wsdl", array()); var_dump($x->test(new foo())); $x = new LocalSoapClient(dirname(__FILE__) . "/bug30928.wsdl", array("classmap" => array('testType' => 'foo'))); var_dump($x->test(new foo())); echo "ok\n";
<?php function test() { return 123.456; } class LocalSoapClient extends SoapClient { function __construct($wsdl, $options) { parent::__construct($wsdl, $options); $this->server = new SoapServer($wsdl, $options); $this->server->addFunction('test'); } function __doRequest($request, $location, $action, $version, $one_way = 0) { ob_start(); $this->server->handle($request); $response = ob_get_contents(); ob_end_clean(); return $response; } } $x = new LocalSoapClient(NULL, array('location' => 'test://', 'uri' => 'http://testuri.org', "trace" => 1)); setlocale(LC_ALL, "sv_SE", "sv_SE.ISO8859-1"); var_dump($x->test()); echo $x->__getLastResponse(); setlocale(LC_ALL, "en_US", "en_US.ISO8859-1"); var_dump($x->test()); echo $x->__getLastResponse();
<?php $d = null; function test($x) { global $d; $d = $x; } class LocalSoapClient extends SoapClient { function __construct($wsdl, $options) { parent::__construct($wsdl, $options); $this->server = new SoapServer($wsdl, $options); $this->server->addFunction('test'); } function __doRequest($request, $location, $action, $version, $one_way = 0) { ob_start(); $this->server->handle($request); $response = ob_get_contents(); ob_end_clean(); return $response; } } $x = new LocalSoapClient(dirname(__FILE__) . "/bug32776.wsdl", array("trace" => true, "exceptions" => false)); var_dump($x->test("Hello")); var_dump($d); var_dump($x->__getLastRequest()); var_dump($x->__getLastResponse()); echo "ok\n";