Working with XML payload
Two disparate systems might agree to interact via XML formats. This means that whenever there is an outgoing communication, the system's data structure needs to be converted to XML; while in the case of incoming messages, it needs to be converted to a data structure understood by the system. How do we do this? Spring provides first-class support to deal with XML via its OXM (Object-to-XML) framework. Marshalling and unmarshalling is done by classes—org.springframework.oxm.Marshaller
and org.springframework.oxm.Unmarshaller
, respectively. Marshaller converts an Object to an XML stream, while unmarshaller converts an XML stream to Object. Spring's Object/XML Mapping support provides several implementations supporting marshalling and unmarshalling using JAXB, Castor, and JiBX among others. Spring Integration abstracts it further and provides many out-of-the-box components, which help to deal with the XML payload. A few of them are marshalling transformer, unmarshalling...