What is an accurate description of the handling of application exceptions thrown by a JAX-WS service endpoint?

What is an accurate description of the handling of application exceptions thrown by a JAX-WS service endpoint?

What is an accurate description of the handling of application exceptions thrown by a JAX-WS service endpoint?

A.
Application exceptions can be mapped to faults in WSDL.

B.
Application exceptions are NOT handled by JAX-WS SEI clients.

C.
Application exceptions are always propagated to JAX-WS clients as RemoteExceptions.

D.
Application exceptions are always propagated to JAX-WS SEI clients as WebServiceExceptions.

E.
Application exceptions are always propagated to JAX-WS SEI clients as SOAPFaultExceptions.



Leave a Reply 4

Your email address will not be published. Required fields are marked *


leo yu

leo yu

question is for web service, not for java, so no consideration of mapping fault to java exception like SOAPFaultException further.

Aneesh

Aneesh

Answer is A?

Mohamed Fayek Saber

Mohamed Fayek Saber

yes

Mohamed Fayek Saber

Mohamed Fayek Saber

https://docs.oracle.com/cd/E24329_01/web.1211/e24965/faults.htm#WSADV624

Overview of Exception Handling Using SOAP Faults

The SOAP specification (available at http://www.w3.org/TR/soap/Opens a new window) defines a standard, platform-independent way of describing the error within the SOAP message using a SOAP fault. In general, a SOAP fault is analogous to an application exception. SOAP faults are generated by receivers to report business logic errors or unexpected conditions.

In JAX-WS, Java exceptions (java.lang.Exception) that are thrown by your Java Web service are mapped to a SOAP fault and returned to the client to communicate the reason for failure. SOAP faults can be one of the following types:

Modeled—Maps to an exception that is thrown explicitly from the business logic of the Java code and mapped to wsdl:fault definitions in the WSDL file, when the Web service is deployed. In this case, the SOAP faults are predefined.

Unmodeled—Maps to an exception (for example, java.lang.RuntimeException) that is generated at run-time when no business logic fault is defined in the WSDL. In this case, Java exceptions are represented as generic SOAP fault exceptions, javax.xml.ws.soap.SOAPFaultException.