I am using axis 1.2.1.
There is a webservice I am supposed to consume as a client.
My problem is i need to distinguish between connectivity problems (such as connection refused, time out, etc )and exception thrown by the Web service itself.
This is because I need to retry the webservice call in case it is a connectivity problem and in case it is an exception thrown by the web service, I need to handle it differently (throw out the exception).
Is there any API/method I can use to distinguish connection exceptions?
I have the following piece of code :
Echo_2_0Stub e = null;
WirelessCSIServiceLocator proxy = new WirelessCSIServiceLocator();
e = (Echo_2_0Stub) proxy.getEcho_2_0_HTTPPort(new URL(
EchoRequestInfo er = new EchoRequestInfo();
EchoResponseInfo eresp = e.echo(er);
Call c = e._getCall();
System.out.println("Req is " + c.getMessageContext().getRequestMessage().getSOAPPartAsString());
Now, is there any way I can check if the service is up before calling EchoResponseInfo eresp = e.echo(er); ?
Or, is there any particular exception/class of exception I can catch, so that I can detect the connection problems?
By connectivity problems, I mean exception like Connection refused, connect timed out,page not found etc.
Whereas the web service itself throws an exception like XYZAplicationException (normally an XYZAplicationException will mean that the request has reached the service and the service has returned an exception in the response).
Could you please advice?