@Policy annotation issue with javaToWSDL

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

@Policy annotation issue with javaToWSDL

Alemoli
Hello!!.
I have a issue with the *@Policy* annotation in CXF 3.2.0.
My web service is a Java First approach and must use WS-SecurityPolicy that
is implemented in a separated file named policyBinding.xml
In the service endpoint interface i put the reference of the Policy with
@Policy annotation:

@Policy(uri =
"./resources/policyBinding.xml",placement=Policy.Placement.DEFAULT)

I use *JavaToWS *to generate the wsdl file and the policy is included in the
wsdl right,but CXF is not aware about it.
Although the url denoting the address location of the web service shows OK
the wsdl with the policy, CXF (integrated in Tomcat) complains with:

        WARNING: Resource classpath:./resources/policyBinding.xml was not found in
the classloaders.

and *no policy is enabled* in the web service.
I put the policyBinding.xml in a resource folder (so in the classpath) and
changed the annotation with:

@Policy(uri =
"classpath:policyBinding.xml",placement=Policy.Placement.DEFAULT)

Now the policy works fine in the web service,but command JavaToWS complains
with:

        WARNING: Resource classpath:policyBinding.xml was not found in the
classloaders.
       
How should be the right @Policy annotation that should work in both
scenarios?

I tried this approach that works (obviously with the two warnings) but is
not the best solution.
@Policies({@Policy(uri =
"classpath:policyBinding.xml",placement=Policy.Placement.DEFAULT),
        @Policy(uri =
"./resources/policyBinding.xml",placement=Policy.Placement.DEFAULT)})


Thanks very much.!!
Alejandro




--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html