concept Java object in category esb

appears as: Java object, Java objects, Java objects
Open-Source ESBs in Action: Example Implementations in Mule and ServiceMix

This is an excerpt from Manning's book Open-Source ESBs in Action: Example Implementations in Mule and ServiceMix.

When you’re working with integration tools, you’re often working with XML. XML provides a standard format for exchanging information between systems. However, working with XML directly from Java is a bit cumbersome. In our integration logic, we want to work with standard Java objects, but we still need a generic format that can be sent between the various components. Many open source libraries are available that allow you to easily transform a Java object to XML and back again, such as Java Architecture for XML Binding (JAXB) and Service Data Objects (SDOs).

In the JiBX mapping file you define the root element name of the XML message (person in this case) and the Java class we want to map it to . Notice that there is a binding root element , which is used by JiBX to represent the start of the mapping definitions. The next part involves defining the mapping between the message child elements and the properties of the Java class . We do this by specifying the name of the XML element (e.g., firstname), and then in the field property we can specify the corresponding Java property (e.g., firstName). Figure 3.2 shows the mapping of a value from an XML file to a property in a Java object.

Figure 3.2. An example of how JiBX maps the elements of an XML message to a Java object