WS-Addressing - 6.3

Talend ESB Service Developer Guide

Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Design and Development
Installation and Upgrade
Talend ESB

WS-Addressing via XML Configuration / Java API

CXF provides support for the 2004-08 and 1.0 versions of WS-Addressing.

To enable WS-Addressing you may enable the WSAddressingFeature on your service. If you wish to use XML to configure this, you may use the following syntax:

<jaxws:endpoint id="{your.service.namespace}YourPortName">
      <wsa:addressing xmlns:wsa=""/>

You can also use the same exact syntax with a <jaxws:client>

<jaxws: client id="{your.service.namespace}YourPortName">
      <wsa:addressing xmlns:wsa=""/>

From an API point of view this looks very similar:

import org.apache.cxf.jaxws.EndpointImpl;

MyServiceImpl implementor =  new MyServiceImpl()
EndpointImpl ep = (EndpointImpl) Endpoint.create(implementor);
ep.getFeatures().add(new WSAddressingFeature());

You can also use it with the ClientProxyFactoryBeans and ServerFactoryBeans (and their JAX-WS versions, namely JaxWsProxyFactoryBean and JaxWsServerFactoryBean):

import org.apache.cxf.frontend.simple.ClientProxyFactoryBean;

ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.getFeatures().add(new WSAddressingFeature());
MyService client = (MyService) factory.create();

Enabling WS-Addressing with WS-Policy

If you're using WS-Policy , CXF can automatically set up WS-Addressing for you if you use the <Addressing> policy expression.

Decoupled responses

By default, WS-Addressing using anonymous Reply-To addresses. This means the request/response patterns are synchronous in nature and the response will be sent back via the normal reply channel. However, WS-Addressing allows for a decoupled endpoint to be used for receiving the response with CXF then correlating it with the appropriate request. There are a few ways for configuring the address on which CXF will listen for decoupled WS-Addressing responses. For HTTP conduit configuration, its client configuration has an option for a DecoupledEndpoint address. If the conduit has this configured, all requests sent via that conduit will have WS-Addressing enabled and their responses sent to that endpoint:


The address can also be set via a Request Context property:


The CXF AddressingPropertiesImpl object can be used to control many aspects of WS-Addressing including the Reply-To:

AddressingProperties maps = new AddressingPropertiesImpl(); 
EndpointReferenceType ref = new EndpointReferenceType(); 
AttributedURIType add = new AttributedURIType(); 

   .put("", maps);

This method can also be used to configure the namespace (version) of the WS-Addressing headers, exact message ID's, and similar information.