camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <>
Subject Re: Modifying SOAP:Fault errors raised by endpoints
Date Mon, 08 Mar 2010 02:53:51 GMT
Hi Jim,

In MESSAGE DataFormat, camel-cxf endpoint will not read the Message 
detail information, it just redirect the input stream.
PAYLOAD and POJO DataFormat will give you the exception that you want.


Jim Talbut wrote:
> 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.
> Ah!
> 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 
> exception.
> Might be worth a note on the Camel CXF page to explain that difference.
> Thanks very much for your help.
> Jim

View raw message