Thursday, 18 July 2019

How To Use Java Architecture for XML Binding (JAXB) in IIB

JAXB enables IIB via the Java Compute Node to work with a model of message data as Java object classes. This Java object model can be accessed and manipulated by using getter and setter methods.

In IIB Toolkit import the XML schema into your application.

Create a message flow with a JavaCompute node, select the Process via Java Architecture for XML Binding (JAXB) class template.

Click Finish.

Select a Message Model Schema file or container with schema from which JAXB Java Object Classes will be generated. Select option to Generate JAXB Java Object Classes from Message Model Schema for us in the Java Compute Node Class.


Type the Java Target Source Folder and the Target Java Package and click Finish.
Accept the default values on the next screen and click Finish.

The JAXB Java object classes are visible in the Application Development view, under the JaxbAppJava(in my case) source folder of the Java project that you selected in the wizard.


The next thing to do is to process the message body data by using JAXB Java object classes, the JAXB Java object classes are a Java object representation of your message.


The code below shows some JAXB code that reads a record from the payload using a getter method.

No comments:

Post a Comment