Edit report at https://bugs.php.net/bug.php?id=60329&edit=1
ID: 60329 Updated by: pierr...@php.net Reported by: pierr...@php.net -Summary: New keep_alive option +Summary: New SoapClient keep_alive option -Status: Open +Status: To be documented Type: Feature/Change Request Package: SOAP related PHP Version: 5.4.0RC1 Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2011-11-18 13:24:24] pierr...@php.net Automatic comment from SVN on behalf of pierrick Revision: http://svn.php.net/viewvc/?view=revision&revision=319472 Log: Added new SoapClient option "keep_alive". FR #60329 ------------------------------------------------------------------------ [2011-11-18 13:18:23] pierr...@php.net Description: ------------ When using the SoapClient you may sometime have this error : SoapClient::__doRequest(): send of 776 bytes failed with errno=32 Broken pipe The problem is that some servers that you're calling are closing the connection after some time. To fix this problem you need to use the "Connection: close" HTTP Header. The only way to do it currently is to use a stream_context with the 1.0 HTTP protocol version : $socket_context = stream_context_create( array('http' => array('protocol_version' => 1.0)) ); $soapClient = new \SOAPClient($serviceUrl, array('stream_context' => $socket_context)); It would be nice to have a new option "keep_alive" that you can disable like this : $soapClient = new \SOAPClient(ServiceUrl, array('keep_alive' => false)); Test script: --------------- $soapClient = new \SOAPClient(ServiceUrl, array('keep_alive' => false)); Expected result: ---------------- Request with "Connection: close" header Actual result: -------------- Request with "Connection: Keep-alive" header ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60329&edit=1