On Sunday, June 12, 2011 8:12:10 AM STEVEN THEIN wrote:
> Why do we need wss4j.jar file for ws-policy. I thought wss4j.jar is for
> SAML.

wss4j is for ws-security stuff, not just SAML.

You likely need to make sure you have the cxf-rt-ws-security jar on the 
classpath.  The other issue is that I don't think the HttpsToken can appear as 
a "root" policy element.   It needs to be part of the a TransportBinding:


<wsp:Policy wsu:Id="UP_policy" 
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">
        <sp:TransportBinding 
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
            <wsp:Policy>
                <sp:TransportToken>
                    <wsp:Policy>
                        <sp:HttpsToken/>
                    </wsp:Policy>
                </sp:TransportToken>
                <sp:Layout>
                    <wsp:Policy>
                        <sp:Strict/>
                    </wsp:Policy>
                </sp:Layout>
                <sp:AlgorithmSuite>
                    <wsp:Policy>
                        <sp:Basic128/>
                    </wsp:Policy>
                </sp:AlgorithmSuite>
            </wsp:Policy>
        </sp:TransportBinding>
.....etc....



Dan


> Thanks
> Steve
> 
> On 6/11/2011 8:32 AM, STEVEN THEIN wrote:
> > Hi
> > 
> >     I am testing ws-policy and in cxf.xml I have the following 
> >     defined.
> > 
> > <cxf:bus>
> > <cxf:inInterceptors>
> > <ref bean="policyIn" />
> > </cxf:inInterceptors>
> > <cxf:features>
> > <p:policies/>
> > </cxf:features>
> > </cxf:bus>
> > 
> > <p:externalAttachment location="classpath:/policies.xml"/>
> > <bean id="policyIn"
> > class="org.apache.cxf.ws.policy.PolicyInInterceptor"/>
> > 
> > In policies.xml I have the following:
> > 
> > 
> > <wsp:PolicyAttachment>
> > <wsp:AppliesTo>
> > <wsa:EndpointReference>
> > <wsa:Address>/TestService</wsa:Address>
> > </wsa:EndpointReference>
> > </wsp:AppliesTo>
> > <wsp:Policy>
> > <sp:HttpsToken RequireClientCertificate="true">
> > <wsp:Policy/>
> > </sp:HttpsToken>
> > </wsp:Policy>
> > </wsp:PolicyAttachment>
> > 
> > 
> > When I ran my app with policies enabled I got "None of the policy
> > alternatives can be satisfied." error.
> > I figured out that I need to include wss4j.jar in my class path.
> > 
> > Is there any other jar file that I can use instead of wss4j.jar?
> > If not how can I get around without using wss4j.jar?
> > 
> > 
> > Thanks
> > Steve
-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to