Return to bug32776.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / soap / tests / bugs |
1.1 misho 1: --TEST-- 2: Bug #32776 (SOAP doesn't support one-way operations) 3: --SKIPIF-- 4: <?php require_once('skipif.inc'); ?> 5: --INI-- 6: soap.wsdl_cache_enabled=0 7: --FILE-- 8: <?php 9: 10: $d = null; 11: 12: function test($x) { 13: global $d; 14: $d = $x; 15: } 16: 17: class LocalSoapClient extends SoapClient { 18: 19: function __construct($wsdl, $options) { 20: parent::__construct($wsdl, $options); 21: $this->server = new SoapServer($wsdl, $options); 22: $this->server->addFunction('test'); 23: } 24: 25: function __doRequest($request, $location, $action, $version, $one_way = 0) { 26: ob_start(); 27: $this->server->handle($request); 28: $response = ob_get_contents(); 29: ob_end_clean(); 30: return $response; 31: } 32: 33: } 34: 35: $x = new LocalSoapClient(dirname(__FILE__)."/bug32776.wsdl",array("trace"=>true,"exceptions"=>false)); 36: var_dump($x->test("Hello")); 37: var_dump($d); 38: var_dump($x->__getLastRequest()); 39: var_dump($x->__getLastResponse()); 40: echo "ok\n"; 41: ?> 42: --EXPECT-- 43: NULL 44: string(5) "Hello" 45: string(459) "<?xml version="1.0" encoding="UTF-8"?> 46: <SOAP-ENV:Envelope 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:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:test><x xsi:type="xsd:string">Hello</x></SOAP-ENV:test></SOAP-ENV:Body></SOAP-ENV:Envelope> 47: " 48: string(0) "" 49: ok