Creating JAXB Java object classes by using the JAXB 2.0 schema compiler

Create Java™ Architecture for XML Binding (JAXB) Java object classes by using the JAXB 2.0 schema compiler from a command window.

Before you begin

  • You must create a message model schema file; see Constructing message models.
  • You might need to add the bin folder of the IBM® Java SDK to your system path. The bin folder of the IBM Java SDK that is included with IBM Integration Bus at install_dir\common\jdk\bin.

About this task

To generate JAXB Java object classes from your message model schema files by using an IBM Integration Bus command window, complete the following steps:

Procedure

  1. In the Application Development view, right-click the message model schema file that you want to use to generate your JAXB Java object classes and select Properties.
    A window opens that shows the properties for your selected message model schema file.
  2. Note the Location of your message model schema file, then click OK to close the properties window.
  3. In the Application Development view, expand the Java project that you want to contain your JAXB Java object classes, then Right-click the src folder and select Properties.
    A window opens that shows the properties for your selected src folder.
  4. Note the Location of your selected src folder, then click OK to close the properties window.
  5. Open an IBM Integration Bus command window. If you have not added the bin folder of the IBM Java SDK to your system path, change directory to this folder. The bin folder of the IBM Java SDK that is included with the IBM Integration Toolkit is located at install_dir\common\jdk\bin
  6. Optional: To view a full list of commands for the JAXB 2.0 schema compiler, enter the following command:
    xjc -help
  7. Enter the following command to create your JAXB Java object classes:
    xjc MessageModelSchema -d JavaProject -p JavaPackage
    Where MessageModelSchema is the location of your message model schema file, JavaProject is the location of the src folder of your Java project, and JavaPackage is the Java package where the generated classes are placed.
    The JAXB 2.0 schema compiler generates JAXB Java object classes from your message model schema file, and saves them to the src folder of the Java project that you specified in the command.
  8. In the IBM Integration Toolkit, open the Package Explorer view:
    1. Click Window > Show view > Other...
    2. In the Show View window, expand Java and select Package Explorer, then click OK.
  9. In the Package Explorer view, right-click the Java project that you selected to contain your JAXB Java object classes and select Refresh.

Results

Your JAXB Java object classes are visible in the Application Development view, under the src folder of your Java project.

What to do next