cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jogesh anand <jogeshan...@rediffmail.com>
Subject org.apache.cxf.ws.policy.PolicyException: These policy alternatives can not be satisfied:
Date Thu, 06 Mar 2014 09:28:03 GMT
*/I am working towards an upgrade from came-cxf 2.9.2 TO camel-cxf 2.12.0
(wss4j 1.6.9)camel-cxf 2.12.0 in turn uses cxf 2.7.6. The wsdl is as
follows./*

<wsdl11:definitions xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/"
	xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:whttp="http://schemas.xmlsoap.org/wsdl/http/"
	xmlns:mime="http:/schemas.xmlsoap.org/wsdl/mime/"

xmlns:sfx="http://www.xmlns.xyzstores.com/AssetManagement/FacilitiesManagement/wsdl/GetBusinessUnitInfo/2.0/"

xmlns:pfx="http://www.xmlns.xyzstores.com/AssetManagement/FacilitiesManagement/datatypes/GetBusinessUnitInfo/2.0/"

xmlns:flt="http://www.xmlns.xyzstores.com/Fault/datatypes/MessageFault/1.0/"
	xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"

targetNamespace="http://www.xmlns.xyzstores.com/AssetManagement/FacilitiesManagement/wsdl/GetBusinessUnitInfo/2.0/">
	<wsp:Policy 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="UsernameToken">
		<wsp:ExactlyOne>
			<wsp:All>
				<sp:SupportingTokens
					xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
					<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:All>
		</wsp:ExactlyOne>
	</wsp:Policy>
....................
....................
<wsdl11:portType name="GetBusinessUnitInfoInterface">
		<wsdl11:operation name="getBusinessUnitDetails">
			<wsp:PolicyReference URI="#UsernameToken"></wsp:PolicyReference>
			<wsdl11:input message="sfx:getBusinessUnitDetails-input"></wsdl11:input>
			<wsdl11:output
message="sfx:getBusinessUnitDetails-output"></wsdl11:output>
			<wsdl11:fault message="sfx:getBusinessUnitDetails-outFault"	
name="getBusinessUnitDetails-outFault"></wsdl11:fault>
</wsdl11:operation>
-----------------------------------------------------------------------------------------------------
*/In my camel context i have wss4j interceptors:/*

<cxf:cxfEndpoint id="basic-locationinfo-ws" address="/getbasiclocationinfo"
		endpointName="c:GetBusinessUnitInfoInterface-SOAP11HTTP"
serviceName="c:GetBusinessUnitInfo"
		wsdlURL="classpath:wsdl/GetBusinessUnitInfoImplementation-V2.0.wsdl"	
xmlns:c="http://www.xmlns.xyzstores.com/AssetManagement/FacilitiesManagement/wsdl/GetBusinessUnitInfo/2.0/">
		<cxf:inInterceptors>
			<ref bean="logInterceptor" />
			<ref bean="securityHandler" />
		</cxf:inInterceptors>
		<cxf:outFaultInterceptors>
			<ref bean="faultInterceptor" />
		</cxf:outFaultInterceptors>
		<cxf:properties><entry key="ws-security.ut.validator"><ref
bean="customUserValidator" /></entry></cxf:properties>
</cxf:cxfEndpoint>

<bean id="securityHandler"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
		<constructor-arg>
			<map>
				<entry key="action" value="UsernameToken" />
				<entry key="passwordType" value="PasswordText" />
			</map>
		</constructor-arg>
	</bean>
<bean id="customUserValidator"
class="com.xyz.eim.common.handler.CustomUserTokenValidator">
		<property name="userProps" ref="credentials" />
		<property name="jasyptEncryptor" ref="jasypt" />
</bean>
------------------------------------------------------------------------------------------------------
*/But i am getting the following exception from ws-security layer:/*

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
-------------------------------------------------------------------------------------------------------
My Soap request is as follows:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header mustUnderstand="1">
	<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
SOAP-ENV:actor="">
		<wsse:UsernameToken><wsse:Username>jOHN</wsse:Username>
		<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">jOHNPASS</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<pfx:getBusinessUnitBasicInfoRequest 
...........................
---------------------------------------------------------------------------------------------------
Where am i going wrong. Is there any issue with my namespaces in request?
What might be the issue here ?




--
View this message in context: http://cxf.547215.n5.nabble.com/org-apache-cxf-ws-policy-PolicyException-These-policy-alternatives-can-not-be-satisfied-tp5740898.html
Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message