Handling Soap timeouts in PHP

前端 未结 8 1777
囚心锁ツ
囚心锁ツ 2021-01-30 09:05

I\'m working on a project where I am verifying information from a user with a SOAP web service. I currently am taking care of errors assuming that I\'m receiving responses from

8条回答
  •  孤城傲影
    2021-01-30 09:49

    Looks like default_socket_timeout is not taken into account when making SOAP calls over HTTPS:

    • Bug #48524 - Timeout setting is not considered on SOAP+HTTPS calls.

    Bug open at the time of writing. As a comment on the blog post Robert Ludwick referenced in a deleted answer Timing Out PHP Soap Calls (21 Oct 2009; by Published by Robert F. Ludwick) points out, the workaround the post discusses (overriding SoapClient::__doRequest() with a curl request) works around this bug also.

    • archived copy of

    Another related bug is:

    • Bug #41631 - default_socket_timeout does not work with SSL

    The code mentioned in the blog post has undergone some changes and can be found in it's latest form with support of HTTP authentication here on Github:

    • SoapClientTimeout.class.php

    In any case, the workaround shouldn't be needed any longer as this problem has been fixed in the PHP SOAPClient extension.

提交回复
热议问题