Skip to end of metadata
Go to start of metadata

JBoss Web Services inherits full WS-Addressing capabilities from the underlying Apache CXF implementation. Apache CXF provides support for 2004-08 and 1.0 versions of WS-Addressing.

Enabling WS-Addressing

WS-Addressing can be turned on in multiple standard ways:

  • consuming a WSDL contract that specifies a WS-Addressing assertion / policy
  • using the @javax.xml.ws.soap.Addressing annotation
  • using the javax.xml.ws.soap.AddressingFeature feature
The supported addressing policy elements are:
[http://www.w3.org/2005/02/addressing/wsdl]UsingAddressing
[http://schemas.xmlsoap.org/ws/2004/08/addressing/policy]UsingAddressing
[http://www.w3.org/2006/05/addressing/wsdl]UsingAddressing
[http://www.w3.org/2007/05/addressing/metadata]Addressing

Alternatively, Apache CXF proprietary ways are also available:

  • specifying the [http://cxf.apache.org/ws/addressing]addressing feature for a given client/endpoint
  • using the org.apache.cxf.ws.addressing.WSAddressingFeature feature through the API
  • manually configuring the Apache CXF addressing interceptors (org.apache.cxf.ws.addressing.MAPAggregator and org.apache.cxf.ws.addressing.soap.MAPCodec)
  • setting the org.apache.cxf.ws.addressing.using property in the message context

Please refer to the the Apache CXF documentation for further information on the proprietary WS-Addressing setup and configuration details.

WS-Addressing Policy

The WS-Addressing support is also perfectly integrated with the Apache CXF WS-Policy engine.

This basically means that the WSDL contract generation for code-first endpoint deployment is policy-aware: users can annotate endpoints with the @javax.xml.ws.soap.Addressing annotation and expect the published WSDL contract to contain proper WS-Addressing policy (assuming no wsdlLocation is specified in the endpoint's @WebService annotation).

Similarly, on client side users do not need to manually specify the javax.xml.ws.soap.AddressingFeature feature, as the policy engine is able to properly process the WS-Addressing policy in the consumed WSDL and turn on addressing as requested.

Example

Here is an example showing how to simply enable WS-Addressing through WS-Policy.

Endpoint

A simple JAX-WS endpoint is prepared using a java-first approach; WS-Addressing is enforced through @Addressing annotation and no wsdlLocation is provided in @WebService:

The WSDL contract that's generated at deploy time and published looks like this:

Client

Since the WS-Policy engine is on by default, the client side code is basically a pure JAX-WS client app:

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.