5 Replies Latest reply: Mar 9, 2007 2:58 PM by frank jemodurn RSS

lower timeout in accessing a web service

Marco Sigismondi Newbie

Hi,
I'm using this code to connect to a web service:

URL url = new URL("http://www.mysite.org/WebService?wsdl");

QName qname = new QName("http://www.mysite.org/","WebService");

ServiceFactoryImpl factory = new ServiceFactoryImpl();
Service service = factory.createService(url, qname);

WebServiceEndpoint endpoint = (WebServiceEndpoint) service.getPort(WebServiceEndpoint.class);



But if the web service is down, this client blocks for about 5 minutes waiting for the web service... till it gives the following exception:

org.jboss.ws.metadata.wsdl.WSDLException: java.net.ConnectException: Connection timed out: connect


Is there a way to decrease the connection timeout?

Thanks.