If using CXF 2.5.0, you can handle this a LOT easier if you just want to
ignore those policies. You can add a bean in the configuration somewhat
like:
<bean class="org.apache.cxf.ws.policy.IgnorablePolicyInterceptorProvider">
<constructor-arg>
<!-- the list of assertion types that can be ignored -->
<list>
<bean class="javax.xml.namespace.QName">
<constructor-arg value="http://tempuri.org/policy"/>
<constructor-arg value="Duplex"/>
</bean>
<bean class="javax.xml.namespace.QName">
<constructor-arg value="http://tempuri.org/policy"/>
<constructor-arg value="OneWay"/>
</bean>
</list>
</constructor-arg>
</bean>
which will tell the runtime to automatically assert those assertions.
Dan
On Tuesday, November 22, 2011 9:35:14 AM pep25abril wrote:
> Hi guys,
>
> I've generated with wsdl2java, a client to invoke a webservice placed in an
> Oracle OSB. The WSDL definition, has ws-security properties, and it uses
> standard assertions (<wsp:Policy>, <wsp:UsingPolicy>, ...) and others that
> are generated automatically like <WL5G3N0:binding>.
>
> Once I execute my client in order to invoke the server, I always get the
> error:
> Caused by: org.apache.cxf.ws.policy.PolicyException: None of the policy
> alternatives can be satisfied.
>
> I've been seeing forums and others, and finally I've included a
> policyinterceptor in order to assert the policies, as it's said in
> http://cxf.547215.n5.nabble.com/Adding-custom-ws-policy-assertions-td558439.
> html .
>
> The problem is that when I get the message in handler method, when I execute
> 'aim = message.get(AssertionInfoMap.class);', aim always gets null value...
> so I can't assert any policy later.
>
> I think I have used almost all the alternatives I have seen in docs, apache
> CXF website, other forums, etc. without succes. Would you have any idea or
> suggestion about this?
>
> Thanks,
>
> Pep
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Getting-error-None-of-the-policy-alternativ
> es-can-be-satisfied-and-no-possibilities-to-solve-it-tp5014166p5014166.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com