You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by neriusv <ne...@gmail.com> on 2012/06/27 15:41:17 UTC

WS-Policy with Spring configuration doesn't show up in wsdl

Hello,

I'm trying to enable WS-SecurityPolicy (username-token) using Spring
configuration in a java-first scenario. *The policy is enforced correctly*,
but it is not included in the generated WSDL (when I access it using ?wsdl).

This is how I define my jaxws endpoint:
____________________________________________

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-policy.xml" />

<jaxws:endpoint id="Service" implementor="my.company.ServiceImpl"
address="/service" >
    <jaxws:properties>
        <entry key="ws-security.callback-handler">
            <bean class="my.company.SimpleServerPasswordCallback"/>
        </entry>
        </jaxws:properties>
        <jaxws:features>
            <p:policies>
                <wsp:PolicyReference 
                    URI="classpath:/META-INF/ws-policy/usernameToken.xml" />
            </p:policies>
        </jaxws:features>
</jaxws:endpoint> 
____________________________________________

I'm using cxf 2.4.6 with ServiceMix 4.4.1 and Apache Camel 2.8.4.

Any ideas?

Thank you in advance,
Nerius.

--
View this message in context: http://cxf.547215.n5.nabble.com/WS-Policy-with-Spring-configuration-doesn-t-show-up-in-wsdl-tp5710372.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: WS-Policy with Spring configuration doesn't show up in wsdl

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday, June 27, 2012 06:41:17 AM neriusv wrote:
> Hello,
> 
> I'm trying to enable WS-SecurityPolicy (username-token) using Spring
> configuration in a java-first scenario. *The policy is enforced
> correctly*, but it is not included in the generated WSDL (when I access
> it using ?wsdl).

Honestly, I'm not sure this has ever worked.   It may work with a newer 
version of CXF, not really sure.   Couple things to try:

1) Newer version of CXF

2) Instead of spring config, try using the @Policy annotation on the SEI or 
IMPL and seeing if that allows it.

3) Use:
<p:policies>
       <wsp:PolicyReference
                URI="#UsernameToken"/>
</p:policies>

and add the policy inline into the spring config as a separate XML element:

<wsp:Policy wsu:Id="UsernameToken" ....


That may allow the policy to be found.

In anycase, a small standalone testcase that shows this not working may be a 
good starting point for a unit test for us to look at.

Dan





> 
> This is how I define my jaxws endpoint:
> ____________________________________________
> 
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-policy.xml" />
> 
> <jaxws:endpoint id="Service" implementor="my.company.ServiceImpl"
> address="/service" >
>     <jaxws:properties>
>         <entry key="ws-security.callback-handler">
>             <bean class="my.company.SimpleServerPasswordCallback"/>
>         </entry>
>         </jaxws:properties>
>         <jaxws:features>
>             <p:policies>
>                 <wsp:PolicyReference
>                     URI="classpath:/META-INF/ws-policy/usernameToken.xml"
> /> </p:policies>
>         </jaxws:features>
> </jaxws:endpoint>
> ____________________________________________
> 
> I'm using cxf 2.4.6 with ServiceMix 4.4.1 and Apache Camel 2.8.4.
> 
> Any ideas?
> 
> Thank you in advance,
> Nerius.
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/WS-Policy-with-Spring-configuration-doesn
> -t-show-up-in-wsdl-tp5710372.html Sent from the cxf-user mailing list
> archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com