0

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 ) );
user1075237
  • 221
  • 1
  • 2
  • 6

1 Answers1

0
try {
//your soap code
} catch (SoapFault $e) {
//error handling
}
Distdev
  • 2,312
  • 16
  • 23