Creating an External Binding Declarations File Using JAX-WS Binding Declarations

5-16 Getting Started With JAX-WS Web Services for Oracle WebLogic Server

5.5.1 Creating an External Binding Declarations File

Create an external binding declarations file that contains all binding declarations for a specific WSDL or XML Schema document. Then, pass the binding declarations file to the binding child element of the wsdlc, jwsc, or clientgen Ant task. The following sections describe: ■ Section 5.5.1.1, Creating an External Binding Declarations File Using JAX-WS Binding Declarations ■ Section 5.5.1.2, Creating an External Binding Declarations File Using JAXB Binding Declarations

5.5.1.1 Creating an External Binding Declarations File Using JAX-WS Binding Declarations

The following sections describe how to specify the root and child elements of the JAX-WS binding declarations file. For information about the custom binding declarations that you can define, see Section 5.5.3, JAX-WS Custom Binding Declarations.

5.5.1.1.1 Specifying the Root Element The jaxws:bindings declaration is the root of

all other binding declarations and defines the location of the WSDL file and the namespace to which the XML Schema conforms: http:java.sun.comxmlnsjaxws . The format of the root declaration is as follows: jaxws:bindings wsdlLocation=uri_of_wsdl jaxws:xmlns=http:java.sun.comxmlnsjaxws uri_of_wsdl specifies the URI of the WSDL file. The package, wrapper style, and asynchronous mapping customizations, defined in Table 5–5 , can be globally defined as part of the root binding declaration in the external customization file. Global bindings apply to the entire scope of the wsdl:definition in the WSDL referenced by the wsdlLocation attribute. The following provides an example of the root binding element that defines the package name, wrapper style, and asynchronous mapping customizations. jaxws:bindings xmlns:wsdl=http:schemas.xmlsoap.orgwsdl wsdlLocation=http:localhost:7001simpleSimpleService?WSDL xmlns:jaxws=http:java.sun.comxmlnsjaxws package name=example.webservices.simple.simpleservice enableWrapperStyletrueenableWrapperStyle enableAsyncMappingfalseenableAsyncMapping jaxws:bindings

5.5.1.1.2 Specifying Child Elements The root jaxws:bindings element can contain

child elements . You specify the WSDL node that is being customized by passing an XPath expression in the node attribute. An XML Schema inlined inside a compiled WSDL file can be customized by using standard JAXB bindings. For more information, see XML Schema Customization in JAX-WS WSDL Customizations at http:jax-ws.java.netnonav2.1.2docscustomizations.html . For Using JAXB Data Binding 5-17 information about the custom JAXB binding declarations that you can define, see Section 5.5.4, JAXB Custom Binding Declarations. For example, the following example defines the package name as examples.webservices.complex.complexservice for the wsdl:definitions node of the WSDL document. jaxws:bindings xmlns:wsdl=http:schemas.xmlsoap.orgwsdl wsdlLocation=http:localhost:7001simpleSimpleService?WSDL xmlns:jaxws=http:java.sun.comxmlnsjaxws jaxws:bindings node=wsdl:definitions xmlns:wsdl=http:schemas.xmlsoap.orgwsdl jaxws:package name=examples.webservices.simple.simpleservice bindings

5.5.1.2 Creating an External Binding Declarations File Using JAXB Binding Declarations