Hi all,

I'm reopening this thread because in the meanwhile there may have been some
updates that I've missed.

The original problem (and for me still open) is that if the called service
returns a SOAPFaultException (or a javax.xml.ws.WebServiceException), the
client needs explicitely to add the catch() clause.
In axis, any ws call was throwing a RemoteException, so my client was
obliged to catch it. In CXF these are all RuntimeException, so I need to
remember to catch them and send back to the caller some graceful error
message.

try {
        ServiceDataInfoResponse resp = client.getServiceDataInfo(req);
        return resp;
} catch (javax.xml.ws.WebServiceException e) {
        // I need to remember to add this catch all the times!!
        throw new MyBusinessException("We are sorry, the service is currently 
not
available.");
}

I see 2 possible solutions, but none fully satisfying:
1. Add a custom SoapInterceptor to the list of client's
InFaultInterceptors() and implement my handleFault(). Here I still don't
know how to notify the fault in a graceful way to the caller.
2. Manipulate the @WebService interface and let the methods throw a
non-runtime exception (like java.rmi.RemoteException in axis), which I'm
obliged to catch.

Has anyonw already faced this issue?

--
View this message in context: 
http://cxf.547215.n5.nabble.com/Handling-internal-errors-via-SOAP-faults-tp559600p5710576.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to