php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36083 SoapClient waits for responses on one-way operations
Submitted: 2006-01-19 12:57 UTC Modified: 2006-02-07 13:49 UTC
From: bugs dot php at inspirationlabs dot net Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.1.2 OS: WinXP SP2, Apache/2.0.54 (Win32)
Private report: No CVE-ID: None
 [2006-01-19 12:57 UTC] 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 !!!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-19 13:30 UTC] tony2001@php.net
Assigned to the maintainer.
 [2006-02-07 13:49 UTC] dmitry@php.net
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));
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC