how to test connectivity to the web service?
In java i have created a JAX- web service, which is up and running, my client connects to the web service. 开发者_StackOverflow中文版
- if web service is up, it works fine. but if my web service is not up, it should show some message to the client about that issue.
- in java how can i implement this functionality.
- My server should show a proper message on client side.
If the web service is not up, it cannot provide any functionality. The client will probably recieve an HTTP error (like 404 - not found or 500 - Internal server error) or a timeout.
To display a useful message to the end user you would need to create a client application through which your web service is accessed. The client application could display appropriate messages in case the service could not be reached. An example of creating a simple JAX-WS client can be found here.
If the service is up, but cannot handle the request, then you could provide a meaningful error in the response by throwing a GenericSoapFault with the error message as argument.
精彩评论