Chapter 20. Deploying WS-Addressing
Abstract
Apache CXF supports WS-Addressing for JAX-WS applications. This chapter explains how to deploy WS-Addressing in the Apache CXF runtime environment.
20.1. Introduction to WS-Addressing Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
WS-Addressing is a specification that allows services to communicate addressing information in a transport neutral way. It consists of two parts:
- A structure for communicating a reference to a Web service endpoint
- A set of Message Addressing Properties (MAP) that associate addressing information with a particular message
Supported specifications Copy linkLink copied to clipboard!
Apache CXF supports both the WS-Addressing 2004/08 specification and the WS-Addressing 2005/03 specification.
Further information Copy linkLink copied to clipboard!
For detailed information on WS-Addressing, see the 2004/08 submission at http://www.w3.org/Submission/ws-addressing/.
20.2. WS-Addressing Interceptors Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
In Apache CXF, WS-Addressing functionality is implemented as interceptors. The Apache CXF runtime uses interceptors to intercept and work with the raw messages that are being sent and received. When a transport receives a message, it creates a message object and sends that message through an interceptor chain. If the WS-Addressing interceptors are added to the application’s interceptor chain, any WS-Addressing information included with a message is processed.
WS-Addressing Interceptors Copy linkLink copied to clipboard!
The WS-Addressing implementation consists of two interceptors, as described in Table 20.1, “WS-Addressing Interceptors”.
Interceptor | Description |
---|---|
| A logical interceptor responsible for aggregating the Message Addressing Properties (MAPs) for outgoing messages. |
| A protocol-specific interceptor responsible for encoding and decoding the Message Addressing Properties (MAPs) as SOAP headers. |
20.3. Enabling WS-Addressing Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
To enable WS-Addressing the WS-Addressing interceptors must be added to the inbound and outbound interceptor chains. This is done in one of the following ways:
- Apache CXF Features
- RMAssertion and WS-Policy Framework
- Using Policy Assertion in a WS-Addressing Feature
Adding WS-Addressing as a Feature Copy linkLink copied to clipboard!
WS-Addressing can be enabled by adding the WS-Addressing feature to the client and the server configuration as shown in Example 20.1, “client.xml and Adding WS-Addressing Feature to Client Configuration” and Example 20.2, “server.xml and Adding WS-Addressing Feature to Server Configuration” respectively.
Example 20.1. client.xml and Adding WS-Addressing Feature to Client Configuration
Example 20.2. server.xml and Adding WS-Addressing Feature to Server Configuration
20.4. Configuring WS-Addressing Attributes Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
The Apache CXF WS-Addressing feature element is defined in the namespace http://cxf.apache.org/ws/addressing
. It supports the two attributes described in Table 20.2, “WS-Addressing Attributes”.
Attribute Name | Value |
---|---|
|
A boolean that determines if duplicate MessageIDs are tolerated. The default setting is |
|
A boolean that indicates if the presence of the |
Configuring WS-Addressing attributes Copy linkLink copied to clipboard!
Configure WS-Addressing attributes by adding the attribute and the value you want to set it to the WS-Addressing feature in your server or client configuration file. For example, the following configuration extract sets the allowDuplicates
attribute to false
on the server endpoint:
Using a WS-Policy assertion embedded in a feature Copy linkLink copied to clipboard!
In Example 20.3, “Using the Policies to Configure WS-Addressing” an addressing policy assertion to enable non-anonymous responses is embedded in the policies
element.
Example 20.3. Using the Policies to Configure WS-Addressing