|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-11-18 13:24 UTC] pierrick@php.net
[2011-11-18 13:24 UTC] pierrick@php.net
-Summary: New keep_alive option
+Summary: New SoapClient keep_alive option
-Status: Open
+Status: To be documented
[2011-11-18 13:24 UTC] pierrick@php.net
[2024-09-07 19:22 UTC] nielsdos@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nielsdos
[2024-09-07 19:22 UTC] nielsdos@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 16:00:01 2025 UTC |
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