camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Talbut <>
Subject Re: Modifying SOAP:Fault errors raised by endpoints
Date Sun, 07 Mar 2010 20:37:34 GMT

On 07/03/2010 20:08, Jim Talbut wrote:
> exchange.getIn().On 07/03/2010 07:05, Claus Ibsen wrote:
>> Hi
>> You can enable the soapFault=true on the CamelContext which turns
>> faults into exceptions.
>> Or you can simply add a processor step at the end of your route, and
>> check if the exchange is a fault
>> public void process(Exchange exchange) {
>> boolean isFault = exchange.hasOut()&&  exchange.getOut().isFault();
>> // do something before the OUT message is returned to the caller
>> }
> Putting on the extra process step works (I didn't know you could do 
> that, I'd assumed that InOut routes were stack-like, but I guess 
> they're actually more like a loop given that they end up back at the 
> source from).
> But neither context.setHandleFault(true) nor 
> from("xxx").handleFault().to("yyy") work - my onException is never 
> called and the soap:fault is returned to the client.
> I think the problem is that the CXF transport isn't setting it as a fault.
My apologies for requiring you to engage psychic debugging (the problem 
with being new to something is that you don't know what is important).

The problem was that I was working in with DataFormat.MESSAGE - and I 
presume that means I'm taking on more responsibility than I want to.
A change to PAYLOAD should be adequate for my needs and now I get an 

Might be worth a note on the Camel CXF page to explain that difference.

Thanks very much for your help.


View raw message