Chapter 6. Standardized Binding Declaration and Customization

Table of Contents

6.1. Overview
6.2. Declaring Standard Binding
6.2.1. Declaring in External Documents (Files)
6.2.2. Declaring in WSDL Documents
6.3. Standard Binding Customization
6.3.1. Global Bindings
6.3.2. Customizing a Package Name
6.3.3. Wrapper Style
6.3.4. Asynchronization
6.3.5. Provider Interface
6.3.6. Customizing Class Name
6.3.7. Customizing Java Methods
6.3.8. Customizing Java Parameters
6.3.9. Customizing XML Schema
6.3.10. Customizing Handler Chains

This chapter describes how to declare and customize standardized binding.

As stated in the previous chapter, JAX-WS web services can be implemented from Java class or WSDL document.

Various functions can be added to implement more extensible web services. They can be added through wsgen by embedding annotations in Java class files, or through wsimport by adding the functions to WSDL documents.

This section introduces binding customization used to configure a client or web service through the wsimport tool by using WSDL document. The next section will provide the function details, and how to configure and implement a Web service with Java classes by using the wsgen tool.

JEUS Web service supports the binding declaration and customization of Java classes in WSDL file (if mainly using the wsimport tool) through a standardized method as requested by JAX-WS. In the existing JAX-RPC web services, this standard is not specified and web services are not portable across vendors.

The following are the roles that the standardized binding declaration and customization plays in implementing web services.

  • Customize mapping from almost all WSDL components to the Java language including service endpoint interface class, method name, parameter name, and exception class.

  • Customize functions like asynchronization, provider, wrapper, and additional headers.

Elements related to all bindings belong to the namespace, http://java.sun.com/xml/ns/jaxws, and bindings are declared as the 'jaxws:bindings' element by adding 'jaxws' to the prefix of the namespace.

A binding can be declared in either of the following.

  • External document.

  • WSDL document.

When declaring binding in an external document (file), the client who is the main user of the web service, passes the WSDL document path as a parameter of the wsimport tool. The path is set in the wsdlLocation element of the binding declaration document.


To configure component binding in the WSDL document, add it as the child element of the previously declared root element. Place the components inside the node element by using the XPath syntax. Add the binding as a child element of the node element.

The following is an example of adding an element for the binding configuration in the WSDL document.


As shown in the previous example, the binding declaration means that the package name of Java classes created for wsdl:definitions in the WSDL document will be customized to 'customize.client'.

The created external binding declaration document can be executed using the wsimport tool as in the following.

$ wsimport -b custom-client.xml http://localhost:8088/AddNumbers/addnumbers?WSDL

This section describes the customization of the declared bindings with the following details.

  • Overall binding

  • Customizing a package name

  • Wrapper style

  • Asynchronization

  • Provider interface

  • Customizing a class name

  • Customizing Java methods

  • Customizing Java parameters

  • Customizing XML schema

  • Customizing handler chains

This section describes how to declare a provider interface through binding declaration. For more information, refer to "Chapter 8. Provider and Dispatch Interfaces".

To declare a port as a provider interface in the WSDL document, use the XPath syntax to configure the wsdl:port node, and then declare the jaxws:provider binding. By default, the provider interface is not declared and is only available when creating a web service from WSDL.

In a WSDL document, wsdl:portType, wsdl:fault, soap:headerfault, and wsdl:server elements are created as Java classes, and the class names can be modified through jaxws:class binding declaration. The following describes each of the Java component classes in the WSDL document.