Nav
You are viewing an older version of this topic. To go to a different version, use the version menu at the upper-right. +

Enabling WS-Addressing

CXF supports the 2004-08 and 1.0 versions of WS-Addressing. To enable WS-Addressing on your services, you must configure the CXF service to use the WS-Adressing feature:


         
      
1
2
3
4
5
<cxf:jaxws-service ... >
  <cxf:features>
    <wsa:addressing />
  </cxf:features>
</cxf:jaxws-service/>

This works with clients as well:


         
      
1
2
3
4
5
<cxf:jaxws-client ... >
  <cxf:features>
    <wsa:addressing />
  </cxf:features>
</cxf:jaxws-client/>

Enabling WS-Addressing Globally

To enable WS-Addressing globally, there are two steps. First, create an external configuration file with the following:


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:cxf="http://cxf.apache.org/core"
  xmlns:wsa="http://cxf.apache.org/ws/addressing"
  xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
  xsi:schemaLocation="
    http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
    http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
  
  <cxf:bus>
    <cxf:features>
      <wsa:addressing/>
    </cxf:features>
  </cxf:bus>
     
</beans>

Second, you’ll need to tell the CXF module to use this configuration file:


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:spring="http://www.springframework.org/schema/beans"
  xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz"
  xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
  xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
       http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.1/mule-cxf.xsd
       http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/3.1/mule-quartz.xsd">
   
    <cxf:configuration configurationLocation="myConfig.xml"/>
...
</mule>

Asynchronous Reply To Destinations

To set up an asynchronous reply to destination for you client, you can set the "decoupledEndpoint" attribute property on your client message processor.


         
      
1
2
3
4
5
<cxf:jaxws-client ... decoupledEndpoint="http://localhost:8888/myReplydestination">
  <cxf:features>
    <wsa:addressing />
  </cxf:features>
</cxf:jaxws-client/>

The URL in the decoupledEndpoint property will be used as your reply to destination for all messages.

Manipulating WS-Addressing Headers

To manipulate the WS-Addressing headers inside the messages, you can write a JAX-WS handler or a CXF interceptor. For a quick start, see the WS-Addressing sample inside the CXF distribution.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

+