Charles,

Within a servicemix-bean service, you can basically use any technology for POJO <-> XML transformation. I usually use JAXB myself, but anything will work there. I don't think there are many helper classes in ServiceMix for doing that. One helper class that is available however is the XStreamSource is . This one was designed to allow you to just use getObject/setObject on the Source object to transfer a POJO and it will use XStream to make to (un)marshal it from/to XML.

Perhaps you should also take a look at Apache Camel's support for working with different data formats (http://activemq.apache.org/camel/data-format.html). There are a few links to code examples there that show you how to use the Java DSL to specify routes which include data format transformation (such as JAXB, XStream, ...). You can quite easily start using Camel inside ServiceMix with the servicemix-camel component (basic tutorial on using this component is work in progress -- have a sneak preview at http://servicemix.apache.org/3-beginner-using-apache-camel-inside-servicemix.html)


Gert

cmoulliard wrote:
Hi,

I see on the forum a lot of discussion using servicemix-bean or
servicemix-jsr181 as SE but nothing concerning the simplest way to map the
XML received through a normalized message to a POJO bean or back from a POJO
bean to normalized message ?

JSR181 uses JAXB2 or AEGIS to map XML to POJO or POJO to XML but JSR181
exposes the service as a web service. In this case, the work of the
developer is simplied. Comparatively, exposing a POJO to the bus, seems less
complicate because WSDL is not required. But How can we map XML to POJO or
POJO to XML (using XStream, Aegis, ...) Do servicemix provide helper or util
classes to perform this ?

Can someone provide a java example demonstrating how to achieve (XML to POJO
vs POJO to XML) this through servicemix-bean ?

Regards,

Charles

Reply via email to