Hi

the addressing headers. Is there some way for the server to indicate
the headers are optional (be it in WSDL or as an attachment), but
still control whether or not the client sends the addressing headers?

Perhaps one option would be to have two service port endpoints, one having the optional <UsingAdressing/> assertion and the other one
making it a requirement...I'm not sure how the CXF client chooses between the 
endpoints by default, but if it picks up the first one
by default then putting a required <UsingAddressing> in the first endpoint 
might work....
This might work out of the box but perhaps it's a bit brittle...

The other option would be to have the client use some policy storage but for this but some work would need to be done. So the service can still have a single endpoint with the optional wsa assertion. The client needs to have either a copy of the WSDL with the required wsa policy assertion (simpliest option but may not be realistic), or better, to get a list of required policies for a given service from some repository using, say, a service Qname...Perhaps CXF can provide a default simplistic implementation of such a storage (I think WS-Feature can be a good fit here as it can wire policy expressions by using ApplyTo to a given endpoint). So, in other words the client needs to be bootstrapped and then, once the policy framework supports it, it can even do the intersection by comparing what it has in the storage for this service endpoint and what the service actually offers, the intersection will always work against the optional WSA service assertion. Actually this is the other advantage of using WS-Policy to express the requirement understood by both a client and a service, as it allows for a generic intersection algorithm to be done...

Cheers, Sergey

----- Original Message ----- From: "Steven E. Harris" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, May 02, 2007 4:30 PM
Subject: Re: How to enable WS-Addressing on a CXF client?


Andrea Smyth <[EMAIL PROTECTED]> writes:

There several ways to do this:

Thank you for your very detailed reply.

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)

I wound up getting this to work using an inline policy in my WSDL
file. What confused me is the wsp:Optional attribute. If I indicate
that the wsam:Addressing assertion is optional, the client never sends
the addressing headers. Is there some way for the server to indicate
the headers are optional (be it in WSDL or as an attachment), but
still control whether or not the client sends the addressing headers?

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

I'm looking into this one today. I see that the addressing policy is
attached to an endpoint via the jaxws:features element. Two questions:

o Does this style of policy specification also require definition of
 the bean with id org.apache.cxf.ws.policy.PolicyEngine of class
 org.apache.cxf.ws.policy.spring.InitializingPolicyEngine?

o How can we find out what all the possible features are that can be
 bound in this manner?

--
Steven E. Harris

Reply via email to