Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOAP <faultstring>

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.

like image 402
Talha Bin Shakir Avatar asked Mar 31 '11 07:03

Talha Bin Shakir


People also ask

What is Faultstring?

<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.

What is the use of SOAP 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.

What is a SOAP fault 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.

How do you make SOAP fault?

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.


1 Answers

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.

like image 175
Stihler Avatar answered Nov 27 '22 19:11

Stihler