Thanks Colm.
From the WSDL, I could see the following
<wsp:UsingPolicy WL5G3N1:Required="true" />
<wsp:Policy WL5G3N0:Id="Auth.xml">
<wssp:Identity xmlns:wssp="http://www.bea.com/wls90/security/policy">
<wssp:SupportedTokens>
<wssp:SecurityToken
TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken">
<wssp:UsePassword
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"
/>
</wssp:SecurityToken>
</wssp:SupportedTokens>
</wssp:Identity>
</wsp:Policy>
I attached the WSDL for your reference.
Stack Trace:
Jul 18, 2017 10:53:17 AM
org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service
{http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl}VuCalendarWS from WSDL:
http://devsdvd.vu.edu.au:9990/VuCalendar/VuCalendarWSSoapHttpPort?wsdl
Invoking getTeachCalendarsPerAcad...
Jul 18, 2017 10:53:17 AM org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl
handleNoRegisteredBuilder
WARNING: No assertion builder for type
{http://www.bea.com/wls90/security/policy}Identity registered.
Jul 18, 2017 10:53:17 AM org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLogging
WARNING: Interceptor for
{http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl}VuCalendarWS#{http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl}getTeachCalendarsPerAcad
has thrown exception, unwinding now
org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can
be satisfied.
at
org.apache.cxf.ws.policy.EffectivePolicyImpl.chooseAlternative(EffectivePolicyImpl.java:199)
at
org.apache.cxf.ws.policy.EffectivePolicyImpl.chooseAlternative(EffectivePolicyImpl.java:192)
at
org.apache.cxf.ws.policy.EffectivePolicyImpl.initialise(EffectivePolicyImpl.java:96)
at
org.apache.cxf.ws.policy.PolicyEngineImpl.getEffectiveClientRequestPolicy(PolicyEngineImpl.java:204)
at
org.apache.cxf.ws.policy.PolicyOutInterceptor.handle(PolicyOutInterceptor.java:98)
at
org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:44)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:518)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:427)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:328)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:281)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
at com.sun.proxy.$Proxy35.getTeachCalendarsPerAcad(Unknown Source)
at
au.edu.vu.its.as.ws.callista.vucalendarws.wsdl.VuCalendarWS_VuCalendarWSSoapHttpPort_Client.main(VuCalendarWS_VuCalendarWSSoapHttpPort_Client.java:49)
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: None of the
policy alternatives can be satisfied.
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
at com.sun.proxy.$Proxy35.getTeachCalendarsPerAcad(Unknown Source)
at
au.edu.vu.its.as.ws.callista.vucalendarws.wsdl.VuCalendarWS_VuCalendarWSSoapHttpPort_Client.main(VuCalendarWS_VuCalendarWSSoapHttpPort_Client.java:49)
Caused by: org.apache.cxf.ws.policy.PolicyException: None of the policy
alternatives can be satisfied.
at
org.apache.cxf.ws.policy.EffectivePolicyImpl.chooseAlternative(EffectivePolicyImpl.java:199)
at
org.apache.cxf.ws.policy.EffectivePolicyImpl.chooseAlternative(EffectivePolicyImpl.java:192)
at
org.apache.cxf.ws.policy.EffectivePolicyImpl.initialise(EffectivePolicyImpl.java:96)
at
org.apache.cxf.ws.policy.PolicyEngineImpl.getEffectiveClientRequestPolicy(PolicyEngineImpl.java:204)
at
org.apache.cxf.ws.policy.PolicyOutInterceptor.handle(PolicyOutInterceptor.java:98)
at
org.apache.cxf.ws.policy.AbstractPolicyInterceptor.handleMessage(AbstractPolicyInterceptor.java:44)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:518)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:427)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:328)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:281)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
... 2 more
Thanks
Siva
-----Original Message-----
From: Colm O hEigeartaigh [mailto:[email protected]]
Sent: Monday, 17 July 2017 6:58 PM
To: [email protected]
Subject: Re: CXF - WS Security Issue
What does the security policy of the service look like? What's the exact stack
trace you get?
Colm.
On Mon, Jul 17, 2017 at 1:22 AM, Siva Kulendrasingam <
[email protected]> wrote:
> Dear Team,
>
> We are trying to consume a web service hosted in Weblogic server using
> the CXF client connector in Mule, but getting the following error.
>
> "None of the policy alternatives can be satisfied.. Failed to route
> event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor".
>
> It seems that the following BEA Weblogic policy is not supported by CXF.
> <wssp:Identity xmlns:wssp="http://www.bea.com/wls90/security/policy">
>
> If we remove the cxf-rt-ws-policy-2.7.15.jar, then it works as
> org.apache.cxf.ws.policy.PolicyOutInterceptor interceptor is not get
> registered.
>
> How this issue would be approached?
>
> CXF Version: 2.7.15
>
> WSDL:
> <flow name="get:/academicCalendars:vuc-api-config">
> <message-properties-transformer
> doc:name="Message Properties">
> <add-message-property key="operation"
> value="getAllAcadCalendars" />
> </message-properties-transformer>
> <set-payload value="#[new Object[]{}]" doc:name="Set
> Payload"></set-payload> <flow-ref name="calendar" doc:name="calendar"
> /> </flow>
>
> <sub-flow name="calendar">
> <cxf:jaxws-client
> clientClass="au.edu.vu.its.as.ws.callista.vucalendarws.
> VuCalendarWS_Service"
> wsdlLocation="${ws.callista.calendar.url}?WSDL" port="
> VuCalendarWSSoapHttpPort"
> doc:name="SOAP">
> <cxf:inInterceptors>
> <spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor"
> /> </cxf:inInterceptors> <cxf:outInterceptors> <spring:bean
> class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
> <spring:bean parent="wss4jOutInterceptor" /> </cxf:outInterceptors>
> </cxf:jaxws-client> <outbound-endpoint doc:name="HTTP"
> address="http://devsdvd.vu.edu.au:9990/VuCalendar/VuCalendarWSSoapHttpPort"
> />
> </sub-flow>
>
> <spring:bean id="wss4jOutConfiguration"
> class="org.springframework.beans.factory.config.MapFactoryBean">
> <spring:property name="sourceMap">
> <spring:map>
> <spring:entry key="action" value="UsernameToken" /> <spring:entry
> key="user" value="${ws.callista.user}" /> <spring:entry
> key="passwordType" value="PasswordText" /> <spring:entry
> key="passwordCallbackClass"
> value="au.edu.vu.its.as.mule.ClientPasswordCallback" /> </spring:map>
> </spring:property> </spring:bean>
>
> <spring:bean id="wss4jOutInterceptor" abstract="true"
> class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
> <spring:property name="properties" ref="wss4jOutConfiguration" />
> </spring:bean>
>
> Thanks
> Siva
>
--
Colm O hEigeartaigh
Talend Community Coder
http://coders.talend.com
<?xml version="1.0" encoding="UTF-8"?>
<WL5G3N1:definitions xmlns:WL5G3N1="http://schemas.xmlsoap.org/wsdl/"
xmlns:WL5G3N0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:WL5G3N2="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl/types/"
xmlns:WL5G3N3="http://www.w3.org/2001/XMLSchema"
xmlns:WL5G3N4="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl"
xmlns:WL5G3N5="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" name="VuCalendarWS"
targetNamespace="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl">
<wsp:UsingPolicy WL5G3N1:Required="true" />
<wsp:Policy WL5G3N0:Id="Auth.xml">
<wssp:Identity xmlns:wssp="http://www.bea.com/wls90/security/policy">
<wssp:SupportedTokens>
<wssp:SecurityToken
TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken">
<wssp:UsePassword
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"
/>
</wssp:SecurityToken>
</wssp:SupportedTokens>
</wssp:Identity>
</wsp:Policy>
<WL5G3N1:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl/types/"
xmlns:tns0="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl/types/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
elementFormDefault="qualified"
targetNamespace="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl/types/">
<xsd:complexType name="CalendaroAcademicCalendarsUserArray">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0"
name="CalendaroAcademicCalendarsUser" nillable="true"
type="tns:CalendaroAcademicCalendarsUser" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CalendaroAcademicCalendarsUser">
<xsd:complexContent>
<xsd:extension base="tns:CalendaroAcademicCalendarsBase">
<xsd:sequence>
<xsd:element name="acadCalType" nillable="true"
type="string" />
<xsd:element name="acadDescription" nillable="true"
type="string" />
<xsd:element name="acadEndDt" nillable="true" type="date"
/>
<xsd:element name="acadStartDt" nillable="true"
type="date" />
<xsd:element name="acadAlternateCd" nillable="true"
type="string" />
<xsd:element name="acadCalCat" nillable="true"
type="string" />
<xsd:element name="acadSeqNo" nillable="true"
type="decimal" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="CalendaroAcademicCalendarsBase">
<xsd:sequence />
</xsd:complexType>
<xsd:complexType name="CalendaroTeachingCalendarsUserArray">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0"
name="CalendaroTeachingCalendarsUser" nillable="true"
type="tns:CalendaroTeachingCalendarsUser" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CalendaroTeachingCalendarsUser">
<xsd:complexContent>
<xsd:extension base="tns:CalendaroTeachingCalendarsBase">
<xsd:sequence>
<xsd:element name="acadCalType" nillable="true"
type="string" />
<xsd:element name="teachStartDt" nillable="true"
type="date" />
<xsd:element name="teachAlternateCd" nillable="true"
type="string" />
<xsd:element name="teachSeqNo" nillable="true"
type="decimal" />
<xsd:element name="teachCalType" nillable="true"
type="string" />
<xsd:element name="acadStartDt" nillable="true"
type="date" />
<xsd:element name="acadAlternateCd" nillable="true"
type="string" />
<xsd:element name="teachCalCat" nillable="true"
type="string" />
<xsd:element name="teachEndDt" nillable="true" type="date"
/>
<xsd:element name="teachDescription" nillable="true"
type="string" />
<xsd:element name="acadSeqNo" nillable="true"
type="decimal" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="CalendaroTeachingCalendarsBase">
<xsd:sequence />
</xsd:complexType>
</xsd:schema>
</WL5G3N1:types>
<WL5G3N1:message name="VuCalendarWS_getAllAcadCalendars" />
<WL5G3N1:message name="VuCalendarWS_getAllAcadCalendarsResponse">
<WL5G3N1:part name="result"
type="WL5G3N2:CalendaroAcademicCalendarsUserArray" />
</WL5G3N1:message>
<WL5G3N1:message name="VuCalendarWS_getTeachCalendarsPerAcad">
<WL5G3N1:part name="acadSeqNo" type="WL5G3N3:int" />
</WL5G3N1:message>
<WL5G3N1:message name="VuCalendarWS_getTeachCalendarsPerAcadResponse">
<WL5G3N1:part name="result"
type="WL5G3N2:CalendaroTeachingCalendarsUserArray" />
</WL5G3N1:message>
<WL5G3N1:portType name="VuCalendarWS">
<WL5G3N1:operation name="getAllAcadCalendars">
<WL5G3N1:input message="WL5G3N4:VuCalendarWS_getAllAcadCalendars" />
<WL5G3N1:output
message="WL5G3N4:VuCalendarWS_getAllAcadCalendarsResponse" />
</WL5G3N1:operation>
<WL5G3N1:operation name="getTeachCalendarsPerAcad"
parameterOrder="acadSeqNo">
<WL5G3N1:input message="WL5G3N4:VuCalendarWS_getTeachCalendarsPerAcad"
/>
<WL5G3N1:output
message="WL5G3N4:VuCalendarWS_getTeachCalendarsPerAcadResponse" />
</WL5G3N1:operation>
</WL5G3N1:portType>
<WL5G3N1:binding name="VuCalendarWS" type="WL5G3N4:VuCalendarWS">
<WL5G3N5:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
<WL5G3N1:operation name="getAllAcadCalendars">
<WL5G3N5:operation
soapAction="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl/getAllAcadCalendars"
/>
<WL5G3N1:input>
<wsp:Policy>
<wsp:PolicyReference URI="#Auth.xml" />
</wsp:Policy>
<WL5G3N5:body
namespace="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl" use="literal"
/>
</WL5G3N1:input>
<WL5G3N1:output>
<WL5G3N5:body
namespace="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl"
parts="result" use="literal" />
</WL5G3N1:output>
</WL5G3N1:operation>
<WL5G3N1:operation name="getTeachCalendarsPerAcad">
<WL5G3N5:operation
soapAction="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl/getTeachCalendarsPerAcad"
/>
<WL5G3N1:input>
<wsp:Policy>
<wsp:PolicyReference URI="#Auth.xml" />
</wsp:Policy>
<WL5G3N5:body
namespace="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl"
parts="acadSeqNo" use="literal" />
</WL5G3N1:input>
<WL5G3N1:output>
<WL5G3N5:body
namespace="http://au/edu/vu/its/as/ws/callista/VuCalendarWS.wsdl"
parts="result" use="literal" />
</WL5G3N1:output>
</WL5G3N1:operation>
</WL5G3N1:binding>
<WL5G3N1:service name="VuCalendarWS">
<WL5G3N1:port binding="WL5G3N4:VuCalendarWS"
name="VuCalendarWSSoapHttpPort">
<WL5G3N5:address
location="http://devsdvd.vu.edu.au:9990/VuCalendar/VuCalendarWSSoapHttpPort" />
</WL5G3N1:port>
</WL5G3N1:service>
</WL5G3N1:definitions>