I am having an issue with the SOAP , when I call my services I get this error:
<faultstring>Fault occurred while processing.</faultstring>
The following response is returned which doesn't give a clue where and why the error happens. How can I customize and show a proper detailed message to user so he/she know what they did wrong
I have gone through the CXF customization with outFaultInterceptors
and inFaultInterceptors
but I am not clear how I am gonna customize cxf.
<faultstring> The <faultstring> element is a mandatory element in the <Fault> element. It provides information about the fault in a form intended for a human reader. <faultactor> The <faultactor> element contains the URI of the SOAP node that generated the fault.
The SOAP <Fault> element carries error and status information in the SOAP message. If an error occurs in a web service, a fault message is returned to the client. The basic structure of the fault message is defined in the SOAP specifications.
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.
The following line of code creates a SOAPFault object and adds it to body. SOAPFault fault = body. addFault(); The SOAPFault interface provides convenience methods that create an element, add the new element to the SOAPFault object, and add a text node, all in one operation.
This means that the web service framework is returning an unchecked exception. Try running the web service on a debugger to see where the exception is happening or wrapping the web service body inside an try/catch to print the stack trace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With