How about this kind of thing:
public static boolean isWebServiceAvailable() {
boolean result = false;
XXX_ServiceLocator locator = new XXX_ServiceLocator();
try {
java.lang.String url = locator.getXXXWebServiceAddress();
java.net.URL netUrl = new java.net.URL(url);
java.net.HttpURLConnection connection =
(java.net.HttpURLConnection)netUrl.openConnection();
connection.connect();
result = (connection.getContent() != null) ? true : false;
}
catch (java.io.IOException ioe) {
System.out.println("Caught an io exception: " + ioe.getMessage());
}
return result;
}
Primitive solution, but at least it will tell you if the service is
there or not, pretty quickly.
Hope it helps.
-jeff
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 12, 2007 11:31 AM
To: [email protected]
Subject: connection timeout
Hi,
We are calling a web service using axis 1.1 and we are setting the
normal timeout to 30 seconds on the Stub class. But when the host is
not there we get the following message after 3 minutes. We want a
quick response when the host is not available. Are there any ideas.
Thanks.
[8/16/07 12:15:57:468 EDT] a96f SystemOut O 12:15:57,467 INFO
com.libertyit.ast.actions.BaseAction : Executing...
com.libertyit.ast.actions.PolicyListAction.execute() :
userPIN=0136450
[8/16/07 12:19:44:641 EDT] a96f SystemOut O 12:19:44,465
ERROR
c.webservice.client.PUBDocumentClient: getDocumentLists : Error
retrieving document list : stack=AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/
envelope/}Server.userException
faultSubcode:
faultString: java.net.ConnectException: Connection timed out
faultActor:
faultNode:
faultDetail:
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]