Check availability of a web server exposed with JaxWS
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();
}





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