Using Apache Camel how do I unmarshal my deserialized object that comes in through a CXF Endpoint?

Posted by ScArcher2 on Stack Overflow See other posts from Stack Overflow or by ScArcher2
Published on 2010-04-13T17:18:14Z Indexed on 2010/04/13 17:23 UTC
Read the original article Hit count: 470

Filed under:
|
|
|

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>

© Stack Overflow or respective owner

Related posts about apache-camel

Related posts about cxf