I have a very simple camel route. It starts with a CXF Endpoint exposed as a web service. I then want to convert it to xml and call a method on a bean.
Currently i'm getting a CXF specific object after the web service call. How do I take my serialized object out of the CXF MessageList and use it going forward?
My Route:
<camel:route>
<camel:from uri="cxf:bean:helloEndpoint" />
<camel:marshal ref="xstream-utf8" />
<camel:to uri="bean:hello?method=hello"/>
</camel:route>
The XML Serialized Message:
<?xml version='1.0' encoding='UTF-8'?>
<org.apache.cxf.message.MessageContentsList serialization="custom">
<unserializable-parents />
<list>
<default>
<size>1</size>
</default>
<int>6</int>
<com.whatever.Person>
<firstName>Joe</firstName>
<middleName></middleName>
<lastName>Buddah</lastName>
<dateOfBirth>2010-04-13 12:09:00.137 CDT</dateOfBirth>
</com.whatever.Person>
</list>
</org.apache.cxf.message.MessageContentsList>
I would expect the XML to be more like this:
<com.whatever.Person>
<firstName>Joe</firstName>
<middleName></middleName>
<lastName>Buddah</lastName>
<dateOfBirth>2010-04-13 12:09:00.137 CDT</dateOfBirth>
</com.whatever.Person>
I found it. I just had to use this.
<camel:convertBodyTo type="com.whatever.Person"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With