Handling exceptions

In JAX-WS, a Java exception thrown from a web service is mapped to SOAP fault when the XML payload is sent to the client. On the client side, JAX-WS maps SOAP fault to either SOAPFaultException or to the application-specific exception. The client code could wrap the web service call in a try...catch block to handle exceptions thrown from the web service.

For a good description of how SOAP exceptions are handled in JAX-WS, refer to https://docs.oracle.com/cd/E24329_01/web.1211/e24965/faults.htm#WSADV624.

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.