note 55956 added to function.soap-soapclient-construct
| From: | JimPlush at osu1 dot php dot net | Date: | Thu, 18 Aug 2005 23:06:15 +0000 |
| Subject: | note 55956 added to function.soap-soapclient-construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93857@lists.php.net to get a copy of this message | ||
an undocumented feature -> setting a connection timeout
$client = new SoapClient($wsdl, array("connection_timeout"=>5));
ideally you'd have two timeouts set in your application one for how long it should take to
actually connect to your remote host and a timeout for how long the socket connection should wait
for a response from the server
the above addresses the time it takes to wait to connect to your host and this addresses the time to
wait for a response
ini_set('default_socket_timeout', 180);
I would wrap this in a configuration option in case you distribute your package and different
clients might need different timeouts when dealing with slow soap server responses.
// SET SOCKET TIMEOUT
if(defined('RESPONSE_TIMEOUT') && RESPONSE_TIMEOUT != '') {
ini_set('default_socket_timeout', RESPONSE_TIMEOUT);
}
----
Manual Page -- http://www.php.net/manual/en/function.soap-soapclient-construct.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55956
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55956&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55956&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55956&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55956&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55956&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55956&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55956&report=yes
Search -- http://master.php.net/manage/user-notes.php