Skip to main content

Check availability of a web server exposed with JaxWS

1 reply [Last post]
jmoralesc
Offline
Joined: 2011-12-29
Points: 0

Hello guys

I am running into a problem with my application, it consists on a web service that exposes some methods and a client that consumes those services, the web service and the client are on different threads so when the web service thread goes down I am getting an exception on my client because he isn't able to find the web service. My question is how can I check if the web service is available without handle the exception? is there any property that can give me that status?

The creation of the proxy is being made with the next instructions

private T createRemoteService(final Class<T> serviceClass) throws IOException {

final JaxWsPortProxyFactoryBean proxyFactoryBean = new JaxWsPortProxyFactoryBean() {{

setServiceInterface(serviceClass);

setNamespaceUri("http://someip.com/");

final String simpleName = serviceClass.getSimpleName();

setServiceName(simpleName);

setWsdlDocumentUrl(new URL(cloudUrl + simpleName + "?wsdl"));

addCustomProperty("com.sun.xml.ws.request.timeout", 180000);

addCustomProperty("com.sun.xml.ws.connect.timeout", 180000);

}};

proxyFactoryBean.afterPropertiesSet();

return (T) proxyFactoryBean.getObject();

}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chiragaegis
Offline
Joined: 2012-04-10
Points: 0

Thanks for sharing..........