doulingqiu4349 2011-12-01 11:07
浏览 56

PHP SOAP - 处理Web服务失败和超时

I'm currently sending data to a web service using PHP SOAP.

Everything is working fine but I'm struggling to find anything in regards to dealing with web service outages, slow response times, etc.

The web service isn't mine so I'm having to simulate no responses by using an incorrect location setting. As it stands a Fatal error is thrown.

The data is stored prior to the SOAP call so ideally I want to try a couple of times and if there is no response store this result and move the user on.

Here is the basis of the code for ref:

    $soap = new SoapClient( null , array( 

    "location" => "https://www.thewebservice.com",
    "uri" => "http://www.w3.org/2001/XMLSchema-instance", 
    "trace"=>true

    ) );

    $ret = $soap->__soapCall( "executeSoap" , Array( $xmlvar ) );
  • 写回答

1条回答 默认 最新

  • douliang2167 2011-12-01 11:10
    关注
    try {
    //your soap code
    } catch (SoapFault $e) {
    //error handling
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题