You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2009/02/10 16:56:34 UTC

svn commit: r743002 - in /tuscany/branches/sca-java-1.x: modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/ modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/ modules/binding-ws-axi...

Author: slaws
Date: Tue Feb 10 15:55:29 2009
New Revision: 743002

URL: http://svn.apache.org/viewvc?rev=743002&view=rev
Log:
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. 

Added:
    tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/
    tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java   (with props)
    tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
Modified:
    tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks
    tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks
    tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks
    tuscany/branches/sca-java-1.x/samples/helloworld-ws-service-secure/src/main/resources/wsdl/helloworld.wsdl

Added: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java?rev=743002&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java Tue Feb 10 15:55:29 2009
@@ -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;
+    }
+}

Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/wspolicy/WSSecurityPolicyHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler?rev=743002&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-axis2-policy/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler Tue Feb 10 15:55:29 2009
@@ -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

Modified: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks?rev=743002&r1=743001&r2=743002&view=diff
==============================================================================
Binary files - no diff available.

Modified: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/mixed/tuscanyKeys.jks?rev=743002&r1=743001&r2=743002&view=diff
==============================================================================
Binary files - no diff available.

Modified: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks?rev=743002&r1=743001&r2=743002&view=diff
==============================================================================
Binary files - no diff available.

Modified: tuscany/branches/sca-java-1.x/samples/helloworld-ws-service-secure/src/main/resources/wsdl/helloworld.wsdl
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/samples/helloworld-ws-service-secure/src/main/resources/wsdl/helloworld.wsdl?rev=743002&r1=743001&r2=743002&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/samples/helloworld-ws-service-secure/src/main/resources/wsdl/helloworld.wsdl (original)
+++ tuscany/branches/sca-java-1.x/samples/helloworld-ws-service-secure/src/main/resources/wsdl/helloworld.wsdl Tue Feb 10 15:55:29 2009
@@ -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>