WAS v8.5 > Develop applications > Develop web services - Addressing (WS-Addressing) > Enable Web Services Addressing support for JAX-WS applications

Enable Web Services Addressing support for JAX-WS applications using WS-Policy

For JAX-WS applications, we can enable WS-Addressing support during the development of a client or service application by adding WS-Policy assertions into the WSDL document.

The JAX-WS 2.2 specification introduces functionality that enables WS-Policy assertions in the application WSDL document to be mapped to and from Java annotations in the code.

There are several ways of enabling WS-Addressing support for JAX-WS applications. The method of using WS-Policy will be effective unless it is overridden by another method with greater precedence, such as if you are using AddressingFeature classes or using Addressing annotations. See the parent topic: Enable Web Services Addressing support for JAX-WS applications for full details about the order of precedence used by WebSphere Application Server.

WAS version 8 supports the JAX-WS 2.2 specification. One of the differences between the JAX-WS 2.1 and JAX-WS 2.2 specifications is that whereas the presence of WS-Policy in an application's WSDL was formerly ignored, if WS-Addressing support is defined within the WS-Policy, this will now be used by WAS in the configuration of the application. As the presence of WS-Policy in an application's WSDL is now checked for WS-Addressing configuration, you may notice a change in behavior in applications formerly run in previous versions of WAS.

If you add an Addressing annotation to your provider code and use the wsgen command-line tool to generate the WSDL document, it will contain WS-Policy assertions specifying the WS-Addressing support. However, if you are looking at the published WSDL document for the provider service, it is possible that policy defined in policy sets is showing, as this would overwrite any annotations defined in the code.

If we are using an existing WSDL document to create Java code, when WAS reads the WSDL, if any WS-Policy assertions specifying WS-Addressing support are present, the generated Java code will contain Addressing annotations.


Results

If you add WS-Addressing annotations to the application code specifying that WS-Addressing is enabled, when we generate the WSDL it will contain WS-Policy assertions.

When WS-Policy assertions specifying WS-Addressing support are included in the WSDL, WS-Addressing headers are included in the generated SOAP messages.

If we specify that WS-Addressing is required and an inbound SOAP message is received that does not include any WS-Addressing headers, an exception occurs.


Related


Enable Web Services Addressing support for JAX-WS applications using addressing annotations
Enable Web Services Addressing support for JAX-WS applications using addressing features
Develop a JAX-WS client from a WSDL file


Reference:

wsgen command for JAX-WS applications
wsimport command for JAX-WS applications


Related information:

Web Services Addressing 1.0 - Metadata specification


+

Search Tips   |   Advanced Search