You can also throw a RuntimeException: http://docs.oracle.com/javase/6/docs/api/javax/xml/ws/handler/Handler.html, which SOAPFaultException subclasses: http://docs.oracle.com/javase/6/docs/api/javax/xml/ws/soap/SOAPFaultException.html.

You can also of course throw the SOAP fault from a web service provider instead: http://www.jroller.com/gmazza/entry/updating_databases_with_jaxws (look at class EmployeePortTypeImpl.java).

Finally, another option is to throw the exception from a CXF Interceptor: http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors. Those throw http://cxf.apache.org/javadoc/latest/org/apache/cxf/interceptor/Fault.html, which may give you more flexibility.

HTH,
Glen

On 08/13/2012 06:02 PM, seanhouse79 wrote:
I have tried to look at your tutorial but it seems like I need to throw a
subclass of Exception inside my public boolean
handleMessage(LogicalMessageContext context) method. But that method doesn't
allow for Exception to be thrown. I tried to throw ProtocolException but the
HandlerChainInvoker doesn't convert that into Exception type. Do you have
any idea?



--
View this message in context: 
http://cxf.547215.n5.nabble.com/How-to-simulate-a-soap-fault-response-with-LogicalHandler-or-SOAPHandler-tp5712444p5712452.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to