Using JAXB Data Binding 5-3
5.2 Developing the JAXB Data Binding Artifacts
The steps to develop the JAXB data binding artifacts using WebLogic Server depend on whether you are starting from a Java class file or a WSDL.
■
Start from Java: Using this programming model, you create the Java classes. At run-time, JAXB marshals the Java objects to generate the XML content which is
then packaged in a SOAP message and sent as a Web service request or response.
To control the Java-to-XML mapping, you include JAXB annotations in your JWS file, as described in
Section 5.4, Customizing Java-to-XML Schema Mapping Using JAXB Annotations.
If no customizations are required, JAXB uses the standard built-in and user-defined data type mapping as described in the
following sections: Section 5.3.1.2, Java-to-XML Mapping for Built-In Data Types
and Section 5.3.2.2, Supported Java User-Defined Data Types.
For more information about this programming model, see Section 3.3, Developing
WebLogic Web Services Starting From Java: Main Steps.
■
Start from WSDL : Using this programming model, the XML Schemas exist and
JAXB unmarshals the XML document to generate the Java objects. To control the XML-to-Java mapping, you can define custom binding declarations
within the WSDL or XML Schema, or in an external file, as described in Section 5.5, Customizing XML Schema-to-Java Mapping Using Binding
Declarations. If no customizations are required, the standard built-in and
user-defined data type mapping as described in the following sections: Section 5.3.1.1, XML-to-Java Mapping for Built-in Data Types
and Section 5.3.2.1,
Supported XML User-Defined Data Types. For more information about this programming model, see
Section 3.4, Developing WebLogic Web Services Starting From a WSDL File: Main Steps.
Please note, when invoking the jwsc, wsdlc, or clientgen Ant tasks described in these procedures:
■
You must specify the type=JAXWS attribute to generate a JAX-WS Web service and JAXB binding artifacts. For jwsc, you specify the type attribute as part of the
jws child element.
■
You can optionally specify the binding child element to specify a customizations file that contains JAX-WS and JAXB data binding customizations.
For information about creating a customizations file, see Section 5.5, Customizing
XML Schema-to-Java Mapping Using Binding Declarations. If no customizations
are required, JAXB uses the standard built-in and user-defined data type mappings described in
Section 5.3, Standard Data Type Mapping. For more information about the jwsc, wsdlc, or clientgen Ant tasks, see Ant Task