camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Ivar Igesund <>
Subject Responses to CXF messages in Camel route
Date Mon, 19 Jan 2009 19:21:54 GMT

I have had a working CXF endpoint (server) connected to my route for a
short while now, but the service only had an in message and the route
looked like this:

from (cxfEndpoint).process(new FooProcessor()).to ( "bean:FooHandler");

However, the caller of the service wants a response which is fairly
simple. OK if the processor (which I guess really should be transform
instead) succeeds, an error message describing the issue if it fails.

So I defined an out message for the operation, and in the first test
(for OK), I expected to be able to do

from (cxfEndpoint).process(new FooProcessor()).to (

This does however fail in the handler step because the out message of
the exchange processed in the FooProcessor is no longer a FooMessage
(even if I do exchange.getOut().setBody(new FooMessage()); but rather
a CxfMessage.

I always assume that I use the API wrong, but in this case the router
acts inconsistently depending on whether the exchange expects an out
message or not. I thought that the out message part where it is
returned to the originating endpoint only should happen at the end of
the route.

As for the fault, I think I want to use the exchange.getFault()
message, but I had some trouble finding a WSDL example where such a
message is defined.

Please help me suggest how the route should look, how to propagate the
messages correctly and properly and how to define the fault message
(in the WSDL). Actually, can I possibly just put an Exception instance into 
the fault message?

Lars Ivar

View raw message