Its the SecurityPolicy issue again, with cxf2.5.1. I ran through all messages
posted in this group across different versions and could not figure out this
issue. At this point, I'm not sure if I am doing wrong or its a side effect
of some neethi updates. Please help
On CXF2.5.1, neethi-3.0.1, wss4j1.6.4,
>>>>>>>>>>>cxf-servlet.xml
<jaxws:endpoint id="pingService"
implementor="com.services.ping.PingPortTypeImpl"
wsdlLocation="C:\work\draft\cxf\BootSampleWAR\WebContent\WEB-INF\wsdl\ping.wsdl"
endpointName="s:pingPort" xmlns:s="http://services.com/ping"
serviceName="s:PingService" address="/PingService">
<jaxws:properties>
<entry key="ws-security.ut.validator">
<ref bean="SecurityInterceptor" />
</entry>
</jaxws:properties>
</jaxws:endpoint>
>>>>>>>>>>>>ping.wsdl
<definitions>
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
xmlns:sp13="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
....
<binding name="pingBinding" type="p0:pingPortType">
<wsp:PolicyReference URI="#PlaintextPolicy" />
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="ping">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" />
....
</binding>
<wsp:Policy wsu:Id="PlaintextPolicy">
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
</wsp:Policy>
</definitions>
>>>>>>>>>>SOAP Input:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<wsse:Security SOAP-ENV:mustUnderstand="1"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-4"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>abcd</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">dcba</wsse:Password>
<wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">ENRcLeFReWqSBGOrzRh2Mw==</wsse:Nonce>
<wsu:Created>2012-02-01T21:03:08.603Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<tns:ping xmlns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://services.workbench.mellon.com/ping"
xmlns:tnsB="http://services.workbench.mellon.com/ping/types/">
<tnsB:str>string</tnsB:str>
</tns:ping>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
>>>>>>>>>>>>Exception
Caused by: org.apache.cxf.ws.policy.PolicyException: These policy
alternatives can not be satisfied:
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}SupportingTokens
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken
at
org.apache.cxf.ws.policy.AssertionInfoMap.checkEffectivePolicy(AssertionInfoMap.java:166)
at
org.apache.cxf.ws.policy.PolicyVerificationInInterceptor.handle(PolicyVerificationInInterceptor.java:101)
at
org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:45)
... 32 more
I then added to cxf-servlet.xml,
<p:engine ignoreUnknownAssertions="false"/>
but encoutered exception>>>>>>>>>>>>>>>>>
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name
'org.apache.cxf.ws.policy.spring.PolicyEngineBeanDefinitionParser$PolicyEngineConfig':
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class
[org.apache.cxf.ws.policy.spring.PolicyEngineBeanDefinitionParser$PolicyEngineConfig]:
No default constructor found; nested exception is
java.lang.NoSuchMethodException:
org.apache.cxf.ws.policy.spring.PolicyEngineBeanDefinitionParser$PolicyEngineConfig.<init>()
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
Am i missing any here?
--
View this message in context:
http://cxf.547215.n5.nabble.com/CXF2-5-1-WS-SecurityPolicy-tp5449316p5449316.html
Sent from the cxf-user mailing list archive at Nabble.com.