Thank Willem,
The first problem I've found with using PAYLOAD is that the Tracer
(which I was using with JPA) is no longer logging the full message contents.
This is because it calls toString on the inbound message, but that is
now a CxfPayload, which contains a List<Element> and Element.toString()
does not walk the DOM.
Is the best approach for resolving this to simply replicate the
functionality of Tracer in my own classes?
Jim
On 08/03/2010 02:53, Willem Jiang wrote:
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.
Willem
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