The wizard is started from the package explorer, by right clicking on the previously generated XML Schema:
The next page allows you to specify which elements from the source XML Schema will need to be bound. All elements are displayed here but if you select a parent element, this will automatically select all children for you, so all you need to do is to select root elements:
In the Adapter case, the mainframe program expects a Dfhcommarea and also produces a Dfhcommarea so that’s the only element we need to select.
The first options button allows you to customize the JAXB classes that will be generated.
The second options button allows you to specify additional Transformers to be generated such as XML and JSON Transformers.
When you click the finish button, an ant script with a name similar to build-coxb-CustomerService.xsd.xml is generated and launched. There are two different java packages that are generated by the ant script:
com.legstar.test.coxb.customerservice contains JAXB classes as generated by Sun’s JAXB XJC utility but with special COBOL annotations as shown on the next screen.
com.legstar.test.coxb.customerservice.bind contains the Transformers classes that can be used for fast marshaling/unmarshaling. Using these classes, there is no need for reflection on the JAXB classes to get the COBOL meta-data at runtime.
The Using generated tranformers section gives examples of code you could write to run Transformers.
The wizard is started from the package explorer, by right clicking on a previously generated XML Schema and then selecting LegStar->Generate Transformers:
In this case, the root structures we are interested in are Search and SearchResponse, which are the wrapper elements expected and produced by the target Web Service. We select them both.
Because Microsoft uses the same names for both Elements and Complex Types, JAXB may complain about name conflicts. To avoid this, you can customize JAXB using the upper options button and specify that all Complex Types should be suffixed with characters "Type":
After you click finish, two Java packages are created, one for JAXB classes with COBOL annotations and one for the optimized Transformers classes.
The Using generated tranformers section gives examples of code you could write to run Transformers.