diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-10 15:55:29 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-02-10 15:55:29 +0000 |
commit | 5f6e43bfa8dca3d3b6481ec86443ef430f97614f (patch) | |
tree | 1ff7b8b29212ccfdc342d0b1db8e57d108a568d6 | |
parent | 1ba87319263e1d8a0ca119a55e2a18be82aa967a (diff) |
TUSCANY-2824 - Turn the binding.ws policy handlers back on. The ws policy handlers are now present but commented out as they are causing problems in the Axis 1.4.1 stack. Update the keys for the binding.ws tests cases so they remain valid for a long time.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@743002 13f79535-47bb-0310-9956-ffa450edef68
6 files changed, 97 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java b/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java new file mode 100644 index 0000000000..7375df3170 --- /dev/null +++ b/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.binding.ws.axis2.policy.wspolicy; + +import org.apache.axis2.AxisFault; +import org.apache.axis2.context.ConfigurationContext; +import org.apache.neethi.Policy; +import org.apache.tuscany.sca.policy.PolicySet; +import org.apache.tuscany.sca.policy.util.PolicyHandler; + +/** + * Policy handler to handle PolicySet containing Policy (WS-Security-Policy) instances + * + * @version $Rev$ $Date$ + */ +public class WSSecurityPolicyHandler implements PolicyHandler { + private PolicySet applicablePolicySet = null; + + public void setUp(Object... context) { + for ( Object contextObject : context ) { + if ( contextObject instanceof ConfigurationContext ) { + ConfigurationContext configContext = (ConfigurationContext)contextObject; + for ( Object policy : applicablePolicySet.getPolicies() ) { + if ( policy instanceof Policy ) { + Policy wsPolicy = (Policy)policy; + try { + configContext.getAxisConfiguration().applyPolicy(wsPolicy); + } catch ( AxisFault e ) { + throw new RuntimeException(e); + } + } + } + } + } + } + + public void cleanUp(Object... context) { + } + + public void beforeInvoke(Object... context) { + + } + + public void afterInvoke(Object... context) { + + } + + public PolicySet getApplicablePolicySet() { + return applicablePolicySet; + } + + public void setApplicablePolicySet(PolicySet applicablePolicySet) { + this.applicablePolicySet = applicablePolicySet; + } +} diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler b/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler new file mode 100644 index 0000000000..0f122a61bf --- /dev/null +++ b/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# PolicyHandlerClasses to interpret specific PolicyModels against specific QoS infrastructures
+# handler classname;qname=<policy intent addressed>;model=<policy model class>
+org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#authentication,model=org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicy
+org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#integrity,model=org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicy
+org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#confidentiality,model=org.apache.tuscany.sca.binding.ws.axis2.policy.configuration.Axis2ConfigParamPolicy
+#org.apache.tuscany.sca.binding.ws.axis2.policy.wspolicy.WSSecurityPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#authentication,model=org.apache.neethi.Policy
+#org.apache.tuscany.sca.binding.ws.axis2.policy.wspolicy.WSSecurityPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#integrity,model=org.apache.neethi.Policy
+#org.apache.tuscany.sca.binding.ws.axis2.policy.wspolicy.WSSecurityPolicyHandler;intent=http://www.osoa.org/xmlns/sca/1.0#confidentiality,model=org.apache.neethi.Policy
\ No newline at end of file diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks Binary files differindex 307edb9b37..0b4f2399f0 100644 --- a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks Binary files differindex 307edb9b37..0b4f2399f0 100644 --- a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks Binary files differindex 307edb9b37..0b4f2399f0 100644 --- a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks diff --git a/branches/sca-java-1.x/samples/helloworld-ws-service-secure/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-1.x/samples/helloworld-ws-service-secure/src/main/resources/wsdl/helloworld.wsdl index 068229be6f..32ad8325e9 100644 --- a/branches/sca-java-1.x/samples/helloworld-ws-service-secure/src/main/resources/wsdl/helloworld.wsdl +++ b/branches/sca-java-1.x/samples/helloworld-ws-service-secure/src/main/resources/wsdl/helloworld.wsdl @@ -72,7 +72,7 @@ <wsdl:service name="HelloWorldService">
<wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
- <wsdlsoap:address location="http://localhost:8085/HelloWorldServiceComponent"/>
+ <wsdlsoap:address location="http://localhost:8085/HelloWorldService"/>
</wsdl:port>
</wsdl:service>
|