Hi

1. Using WS-Policy:
Enable the policy framework (by setting the "enabled" attribute of the 
PolicyEngine to true)

Seems like the best option...I'm wandering would it be possible to enhance the framework over time to avoid explicitly enabling PolicyEngine (say, it gets enabled once the first policy expression is encountered, or may be it's enabled all the time, it should have no adverse effect in the absense of any policy expressions, should it) ? If it were possible then a single WS-Policy WSA expression attched to the service's WSDL would enable the WSA on the server and on the client...

Cheers, Sergey

Steven E. Harris wrote:

I generated a client stub from my WSDL and am testing it against an
existing service of mine. It was amazing to see a default SOAP client
rise to the occasion when I first tried to run my test; it took a
moment to realize that this was not CXF's implementation, as I had not
yet added the proper CXF dependencies to my class path. Once I added
those, several things changed, and I'm still sorting through it all.

First, though, I need WS-Addressing. My service is expecting clients
to provide WS-Addressing headers. I've seen some mention of
WS-Addressing support being ready in CXF, and see some types in the
source that look related, but I haven't found sufficient documentation
to clarify how to enable WS-Addressing for a client.

Please advise.


Hi Steven,

There several ways to do this:
1. Using WS-Policy:
Enable the policy framework (by setting the "enabled" attribute of the PolicyEngine to true) and making sure that a Policy with an Addressing assertion is attached to the WSDL service, port, portType or interface
(see cfg file addr.xml for system test 
org.apache.cxf.systest.ws.policy.AddressingPolicyTest)
2. Using CXF Features:
This is relatively new, and I don't know much about them, but see cfg file addr-inline-policy.xml for system test org.apache.cxf.systest.ws.policy.AddressingInlinePolicyTest
3. By manually adding the addressing interceptors (MAPCodec and MAPAggregator)
See cfg file wsa_interceptors.xml for system test org.apache.cxf.systest.ws.addr.MAPTest (this also shows how to configure the http transport for non-anonymous responses). When not using an addressing assertion, a UsingAddressing element should be attached to the port element to 'activate' the addressing interceptors.

Cheers,
Andrea.



Reply via email to