I think you need to set the mode back to PAYLOAD mode inside the second processor (convertResponse) until CAMEL-3420 is fixed and delivered. I added a unit test for your reference.

https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java

On 12/09/2010 02:28 AM, Thomas KRIECHBAUM wrote:
Hello,

the conversion does not help. It seams, that the second cxf-component
(POJO) changes the camel exchange in a way the first cxf-component
(PAYLOAD) can't deal with. For simplicity, I have bound both components to
the same WSDL, but even if I wrap the response from the second
cxf-component to an CxPayload (body-list contains one DOM-element) it
could not be serialized to XML by the XMLStreamDataWriter.

Here is my route:
from(cxf://...?dataFormat=PAYLOAD).process(convertRequest).to(cxf://...?dataFormat=POJO).process(convertResponse)

Do I have to apply some kind of pattern to preserve to information of the
first cxf-component (headers, CxfConstants.DATA_FORMAT_PROPERTY, ...)
before invoking the second cxf-component?
Can the second cxf-compoent works on its own camel exchange instance?

For testing purposes, if have implemented a processor that creates the
CxfPayload without calling the second cxf-component. In this case, the
CxfPayload is serialized to XML as expected.
The route:
from(cxf://...?dataFormat=PAYLOAD).process(createPayload)

Mixing of POJO and PAYLOAD is probably fine but you have to do some
conversion (e.g. in a processor).  You know the message body for POJO
mode is List<Object>  and for PAYLOAD mode is CxfPayload.   So, it needs
conversion from a List<Object>  to CxfPayload for the request and convert
back from CxfPayload to List<Object>  on the response.

from(cxf://...?dataFormat=POJO).process(convertRequest).to(cxf://...?
dataFormat=PAYLOAD).process(convertResponse)




Der Austausch von Nachrichten mit o.a. Absender via e-mail dient ausschließlich 
Informationszwecken. Rechtsgeschäftliche Erklärungen dürfen über dieses Medium 
nicht ausgetauscht werden.

Correspondence with a.m. sender via e-mail is only for information purposes. 
This medium is not to be used for the exchange of legally-binding 
communications.

Reply via email to