【问题标题】:when nusoap is calling a web service from PHP application, handling timeout issues当 nusoap 从 PHP 应用程序调用 Web 服务时,处理超时问题
【发布时间】:2016-06-24 14:10:03
【问题描述】:

调用 .net 网络服务时,我在我的 PHP 应用程序中使用了 nusoap。

问题是,在某些情况下,.net Web 服务花费的时间超过了某些请求的实际时间,所以我想增加我的 SOAP 调用等待响应的时间。

是否有任何功能或任何方法可以让我保持 nusoap 调用等待,直到我收到来自 web 服务的响应。

谢谢, 罗摩

【问题讨论】:

    标签: nusoap


    【解决方案1】:

    Nusoap 默认超时为 30 秒。

    增加响应超时来解决这个问题。

    // creates an instance of the SOAP client object
     $client = new nusoap_client($create_url, true);
    
    // creates a proxy so that WSDL methods can be accessed directly
    $proxy = $client -> getProxy();
    
    // Set timeouts, nusoap default is 30
    $client->timeout = 0;
    $client->response_timeout = 100;
    

    注意:此设置在一段时间内也不起作用。所以我直接去 nusoap.php 文件并更改 $response_timeout = 120。默认情况下,此值设置为 30 秒。

    现在解决了:)

    参考:Time out settings - Second reference

    【讨论】:

      【解决方案2】:

      当你创建 nusoap_client 的 istance 时尝试

      $client = new nusoap_client($$creat_url, true,false,false,false,false,0,300);
      

      其中所有的假参数默认为假, 0 是超时,300 是 response_timeout

      谢谢

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-02-26
        • 2012-08-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-01-10
        相关资源
        最近更新 更多