Hi,

I'm using CXF version 3.1.1 and I am trying to attach a WS-SecurityPolicy to my 
jax-ws:endpoint.  
I have been successful with Axis2/Rampart, but for some reason I can't seem to 
enforce the policy with CXF.

In my WSDL I have added a simple policy :

    <wsp:Policy wsu:Id="SignBody">
        <wsp:ExactlyOne>
            <wsp:All>
                <sp:SignedParts>
                    <sp:Body/>
                </sp:SignedParts>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>

And I have added policy references in my binding :

    <wsdl:binding name="TestServiceSoapBinding" type="tns:TestService">
        <wsp:PolicyReference URI="#SignBody"/>
        <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"; />
        <wsdl:operation name="echo">
            <soap:operation soapAction="" />
            <wsdl:input name="echo">
                <wsp:PolicyReference URI="#SignBody"/>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output name="echoResponse">
                <wsp:PolicyReference URI="#SignBody"/>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

However, using SoapUI I can still call the operation without applying any 
security and nothing special is logged.
I have tried to debug the PolicyInInterceptor, it seems like the Policy is 
getting created but that the Wsdl11AttachmentPolicyProvider is not providing  
the policy.

Is there something I'm missing ?
Is there a sample test project for this I could try ?

Thank you for your help!
Alex
                                          

Reply via email to