The JAXB transformers allow objects to be serialized to XML and back again using the JAXB binding framework. To configure a transformer that will convert XML to a
Person object use
You can then reference this transformer from an endpoint:
returnClass is a common transformer attribute and defines that this transformer will create a
Note that we have a reference to a
JAXBContext via the
jaxbContext-ref attribute, you can create this context object in your configuration file.
You can always use Spring to create objects as well. To create the
The opposite transformer would allow you to convert from a
Person object to XML -
Mule offers automatic JAXB Bindings so you don't even need use these transformers for most scenarios.