Using the Runtime Binding Framework
Schema-2-Java
Schema-2-Java is the process of compiling one or more schema files into generated Java classes. Here are some of the basic steps for developing an app:
- Develop/locate your schema
- Annotate the schema with binding customizations if necessary (or place them in an external bindings file)
- Compile the schema with the XJC binding compiler
- Develop your JAXB client application using the Java content classes generated by the XJC binding compiler along with the javax.xml.bind runtime framework
- Set your CLASSPATH to include all of the JAR files
- Compile all of your Java sources with javac
- Run it!
Java-2-Schema
Java-2-Schema is the process of augmenting existing Java classes with the annotations defined in the javax.xml.bind.annotation package so that the JAXB runtime binding framework is capable of performing the un/marshal operations. Here are the basic steps for developing an app:
- Develop your data model in Java
- Apply the javax.xml.bind.annotation annotations to control the binding process
- Set your CLASSPATH to include all of the JAR files
- Compile your data model with javac (Important! make sure that you classpath includes jaxb-xjc.jar before running javac)
- The resulting class files will contain your annotations as well other default annotations needed by the JAXB runtime binding framework
- Develop your client application that uses the data model and develop the code that uses the JAXB runtime binding framework to persist your data model using the un/marshal operations.
- Compile and run your client application!
For more information about this process, see the the Java WSDP Tutorial and the extensive sample application documentation.
Building and Running the Sample Apps with Ant
To run the sample applications, just go into each sample directory, and run ant without any option.
A few sample applications do not use Ant. For those samples, refer to the included readme.txt files for instructions.
No comments:
Post a Comment