Jump to content

SoapClient hung response does not produce catchable Exception?


adcworks

Recommended Posts

Hi,

I have a SoapClient instantiation as follows

[code]
try {
  $client = new SoapClient(CI_WSDL, $GLOBALS['ws_defaults']);
} catch (Exception $e) {
  // do something
}
[/code]

This is working OK without any problem locating the WSDL file. Indeed, I can access it in IE also. All good.

However, when I call a tx service as follows

[code]try {
  $LOG->debug("sending tx");
  $result = $client->CardTxn(
  array("xmlStream"=>
    $TX_XML_STREAM_HEAD .
    "<TxnType>01</TxnType>" .
  $TX_XML_STREAM_FOOT)
  );
  $LOG->debug("sent tx");
} catch (Exception $e) {
  $LOG->error("Error: " . $e->getMessage());
}[/code]

The code/browser hangs for about 2 minutes and then PHP throws a Fatal Error: connection wait time of 60 seconds exceeded.

That's fine, I don't mind things timing out (this service call usually works but the service provider must be having a problem), but what I do mind is that I cannot catch the exception and do something graceful for the user.

The catch block is never entered into, I don't get any debug, it just dies with a Fatal Error.

Can anyone suggest if I am not catching the problem correctly?

Thanks! ???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.