#36083 [Asn->Csd]: SoapClient waits for responses on one-way operations

From: Date: Tue, 07 Feb 2006 12:49:46 +0000
Subject: #36083 [Asn->Csd]: SoapClient waits for responses on one-way operations
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93012@lists.php.net to get a copy of this message
ID: 36083 Updated by: dmitry@php.net Reported By: bugs dot php at inspirationlabs dot net -Status: Assigned +Status: Closed Bug Type: SOAP related Operating System: WinXP SP2, Apache/2.0.54 (Win32) PHP Version: 5.1.2 Assigned To: dmitry New Comment: Fixed in CVS HEAD and PHP_5_1. Now SoapClient doesn't wait for one-way operations by default, but it is possible to use old behavior: $soap = new SoapClient($wsdl, array("features"=>SOAP_WAIT_ONE_WAY_CALLS)); Previous Comments: ------------------------------------------------------------------------ [2006-01-19 13:30:27] tony2001@php.net Assigned to the maintainer. ------------------------------------------------------------------------ [2006-01-19 12:57:39] bugs dot php at inspirationlabs dot net Description: ------------ Try to call SoapService in one-way operation. Client waits until SoapServer answeres. I think the SoapServer has to return HTTP "202 Accepted" response (see Bug #32776), that is right, but the response must been send before the Server executed SoapServer->handle(). Reproduce code: --------------- SoapClient: <?php $starttime = microtime(true); $client = new SoapClient("oneway.wsdl", array( 'trace' => 1)); $client->foo("fooInput"); echo "UsedTime: ".(microtime(true) - $starttime); ?> SoapServer: <?php function foo($input) { sleep(7); } $Server = new SoapServer("oneway.wsdl"); $Server->addFunction("foo"); $Server->handle(); ?> WSDL (part): <portType name="serverPortType"> <operation name="foo"> <input message="typens:foo"/> </operation> </portType> <binding name="serverBinding" type="typens:serverPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="foo"> <soap:operation soapAction="urn:serverAction"/> <input> <soap:body namespace="urn:oneway.wsdl" use="literal"/> </input> </operation> </binding> Expected result: ---------------- Server must answer under 1 Second, so Client Output Result is like: UsedTime: 0.0034999847412 Actual result: -------------- Server answers after sleep(7), Client waits until Server sending all Headers. So Client Output Result is like: UsedTime: 7.0034999847412 !!! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36083&edit=1

« previous php.bugs (#93012) next »