I am now getting the policy populated in the WSDL, but it's showing up twice:
</wsdl:port>
</wsdl:service>
<wsp:Policy wsu:Id="UsernameToken"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsp:ExactlyOne>
<wsp:All>
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<wsp:Policy><sp:WssUsernameToken10/></wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsp:Policy wsu:Id="UsernameToken"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsp:ExactlyOne>
<wsp:All>
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<wsp:Policy><sp:WssUsernameToken10/></wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</wsdl:definitions>
The reference to the policy also appears twice under wsdl:binding...
I have the following annotation:
@Policy(uri="wsPolicy.xml", includeInWSDL=true)
@WebService(...)
@SOAPBinding(...)
public interface MyService {
Any ideas why it is being duplicated?
Thanks,
Jeremy Robertson
-----Original Message-----
From: Daniel Kulp [mailto:[email protected]]
Sent: Tuesday, December 07, 2010 12:48 PM
To: Jeremy Robertson
Subject: Re: using @Policy to populate WSDL
On Tuesday 07 December 2010 2:38:30 pm Jeremy Robertson wrote:
> Adding that import did the trick. Thanks!
> <import resource="classpath:META-INF/cxf/cxf-extension-policy.xml" />
Added to the docs. Thanks!
Dan
>
> Jeremy
>
> -----Original Message-----
> From: Daniel Kulp [mailto:[email protected]]
> Sent: Tuesday, December 07, 2010 12:04 PM
> To: [email protected]
> Cc: Jeremy Robertson
> Subject: Re: using @Policy to populate WSDL
>
>
> What does your spring config look like? Are you importing
> META-INF/cxf/cxf-extension-policy.xml ?
>
>
> Dan
>
> On Tuesday 07 December 2010 1:17:03 pm Jeremy Robertson wrote:
> > I am trying to use @Policy to add security information to the WSDL, but
> > so far it does not seem to have any effect.
> >
> > Here is what I have specified:
> > @Policies({
> >
> > //@Policy(uri="resources/wsPolicy.xml", includeInWSDL=true)
> > @Policy(uri="wsPolicy.xml", includeInWSDL=true)
> >
> > })
> >
> > I have tried specifying this on individual methods as well as on the
> > service interface. I also tried enabling the policy framework (<p:engine
> > enabled="true" ignoreUnknownAssertions="true"/>).
> >
> > I tried placing the referenced wsPolicy.xml both in the resources folder
> > (src/main/resources), and also in the site root.
> >
> > I am not seeing any errors or warnings about not being able to find the
> > policy file or about it being invalid (although it may not be valid at
> > this point)... As far as I can make out, the annotation is being ignored.
> >
> > I am currently using CXF 2.3.1, Spring 3.0.5, and Maven.
> >
> > Can anyone give me any further guidance on what I need to do?
> >
> >
> > Thanks,
> > Jeremy Robertson
> >
> > NOTICE: This email message is for the sole use of the intended
> >
> > recipient(s) and may contain confidential and privileged information. Any
> > unauthorized review, use, disclosure or distribution is prohibited. If
> > you are not the intended recipient, please contact the sender by reply
> > email and destroy all copies of the original message.
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
NOTICE: This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not the
intended recipient, please contact the sender by reply email and destroy all
copies of the original message.