yedlurisrinu
Jul 26th, 2010, 08:35 PM
Hi ,
Let me give you the back ground of the issue.
We have some web services running on Weblogic 10.3.1. All the client services are routed through OSB(Oracle Service Bus 10.3.1), it uses native Auth.xml as policy file and plain username/password authenticating.
The problem is that client side systems are upgraded to to Weblogic 10.3.2 and now when they are trying to access the web services through OSB they are getting the below exception. weblogic.wsee.ws.init.WsDeploymentException: The WebLogic Server 9.x-style policy is not supported in JAX-WS web services
The Limitations:
1. Services proxy can't be movied to 10.3.2 (OSB) as it might take lot of time and effort.
2. We can't mute the authentication
3. Oracle-Weblogic doen't have straightforward fix, they want us to move to 10.3.2.
Work Around Provided By Oracle:
They have given us the below solution which will work fine with pure java web services but not for Spring based web services. It is like uploading server side policy file on to client side programatically so that it will overwrite the latest policies on the client side.
You can use Wssp1.2-2007-Https-UsernameToken-Plain.xml or
Wssp1.2-2007-Https-UsernameToken-Digest.xml. Https is required for plain
password. For digest, you can remove the TransportBinding.
ClientPolicyFeature feature = new ClientPolicyFeature();
InputStream [] inputPolicies = new InputStream[1];
inputPolicies[0] = this.getClass().getResourceAsStream("policy.xml");
feature.setEffectivePolicyForInputMessage( new
InputStreamPolicySource(inputPolicies));
port = service.getXXXPort(feature);
<?xml version="1.0"?>
<wsp:Policy
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
>
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:HashPassword/>
<sp:WssUsernameToken10/>
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
</wsp:Policy>
=============================
Now, I am trying to load the policy using the below Interceptor, but I am getting the below error message
cvc-elt.1: Cannot find the declaration of element 'wsp:Policy'
The configuration is as below.
<bean id="wsSecurityInterceptor"
class="org.springframework.ws.soap.security.xwss.XwsSecur ityInterceptor">
<property name="policyConfiguration" value="classpath:com/..../policies/Wssp1.2-2007-Https-UsernameToken-Plain.xml"/>
<property name="callbackHandler">
<bean class="org.springframework.ws.soap.security.xwss.callback .MockValidationCallbackHandler" />
</property>
</bean>
The policy file is as below.
<?xml version="1.0"?>
<wsp:Policy
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:WssUsernameToken10/>
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
</wsp:Policy>
could any one help us where is could be the problem. Thanks.
Let me give you the back ground of the issue.
We have some web services running on Weblogic 10.3.1. All the client services are routed through OSB(Oracle Service Bus 10.3.1), it uses native Auth.xml as policy file and plain username/password authenticating.
The problem is that client side systems are upgraded to to Weblogic 10.3.2 and now when they are trying to access the web services through OSB they are getting the below exception. weblogic.wsee.ws.init.WsDeploymentException: The WebLogic Server 9.x-style policy is not supported in JAX-WS web services
The Limitations:
1. Services proxy can't be movied to 10.3.2 (OSB) as it might take lot of time and effort.
2. We can't mute the authentication
3. Oracle-Weblogic doen't have straightforward fix, they want us to move to 10.3.2.
Work Around Provided By Oracle:
They have given us the below solution which will work fine with pure java web services but not for Spring based web services. It is like uploading server side policy file on to client side programatically so that it will overwrite the latest policies on the client side.
You can use Wssp1.2-2007-Https-UsernameToken-Plain.xml or
Wssp1.2-2007-Https-UsernameToken-Digest.xml. Https is required for plain
password. For digest, you can remove the TransportBinding.
ClientPolicyFeature feature = new ClientPolicyFeature();
InputStream [] inputPolicies = new InputStream[1];
inputPolicies[0] = this.getClass().getResourceAsStream("policy.xml");
feature.setEffectivePolicyForInputMessage( new
InputStreamPolicySource(inputPolicies));
port = service.getXXXPort(feature);
<?xml version="1.0"?>
<wsp:Policy
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
>
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:HashPassword/>
<sp:WssUsernameToken10/>
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
</wsp:Policy>
=============================
Now, I am trying to load the policy using the below Interceptor, but I am getting the below error message
cvc-elt.1: Cannot find the declaration of element 'wsp:Policy'
The configuration is as below.
<bean id="wsSecurityInterceptor"
class="org.springframework.ws.soap.security.xwss.XwsSecur ityInterceptor">
<property name="policyConfiguration" value="classpath:com/..../policies/Wssp1.2-2007-Https-UsernameToken-Plain.xml"/>
<property name="callbackHandler">
<bean class="org.springframework.ws.soap.security.xwss.callback .MockValidationCallbackHandler" />
</property>
</bean>
The policy file is as below.
<?xml version="1.0"?>
<wsp:Policy
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:WssUsernameToken10/>
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
</wsp:Policy>
could any one help us where is could be the problem. Thanks.