You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2005/08/11 06:21:33 UTC

svn commit: r231391 - in /webservices/axis/trunk/java/modules/core/src/org/apache/axis2: Constants.java deployment/DeploymentParser.java description/ServiceDescription.java

Author: deepal
Date: Wed Aug 10 21:21:16 2005
New Revision: 231391

URL: http://svn.apache.org/viewcvs?rev=231391&view=rev
Log:
it can posible to add wsa mappingaction in opeartion tag in service.xml , and one opeartion can have more than one wsaaction mapping and the way of adding them is just add mapping paramaters in the service.xml (inside opeartion tag) and the parameter will be look like follows;

<paramater name="wsamapping"> wsa mapping </parameter>

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/Constants.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/Constants.java?rev=231391&r1=231390&r2=231391&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/Constants.java Wed Aug 10 21:21:16 2005
@@ -185,6 +185,7 @@
     public static final String VALUE_FALSE = "false";
     public static final String CONTAINER_MANAGED = "ContainerManaged";
     public static final String RESPONSE_WRITTEN = "CONTENT_WRITTEN";
+    public static final String WSA_ACTION = "wsamapping";
 
 
     public static final String TESTING_PATH = "target/test-resources/";

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java?rev=231391&r1=231390&r2=231391&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentParser.java Wed Aug 10 21:21:16 2005
@@ -17,6 +17,7 @@
 package org.apache.axis2.deployment;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.deployment.util.PhasesInfo;
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfigurationImpl;
@@ -814,6 +815,9 @@
                         }
                     } else if (PARAMETERST.equals(ST)) {
                         Parameter parameter = processParameter();
+                        if(parameter.getName().equals(Constants.WSA_ACTION)){
+                            axisService.addMapping((String)parameter.getValue(),operation);
+                        }
                         operation.addParameter(parameter);
                     } else if (IN_FAILTFLOW.equals(ST)) {
                         throw new UnsupportedOperationException(Messages.getMessage(DeploymentErrorMsgs.UNKNOWN_IN_OPERATION, ST));

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java?rev=231391&r1=231390&r2=231391&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java Wed Aug 10 21:21:16 2005
@@ -18,6 +18,7 @@
 import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
 import com.ibm.wsdl.extensions.soap.SOAPConstants;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.engine.AxisConfiguration;
@@ -64,12 +65,15 @@
 
     private WSDLServiceImpl serviceimpl = null;
 
+    private HashMap wasaction_opeartionmap = null;
+
     /**
      * Constructor ServiceDescription
      */
 
     public ServiceDescription(WSDLServiceImpl serviceimpl){
         this.serviceimpl = serviceimpl;
+        this.wasaction_opeartionmap = new HashMap();
         this.setComponentProperty(MODULEREF_KEY, new ArrayList());
         this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());
         this.setServiceInterface(new WSDLInterfaceImpl());
@@ -77,6 +81,7 @@
 
     public ServiceDescription() {
         this.serviceimpl = new WSDLServiceImpl();
+        this.wasaction_opeartionmap = new HashMap();
         this.setComponentProperty(MODULEREF_KEY, new ArrayList());
         this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());
         this.setServiceInterface(new WSDLInterfaceImpl());
@@ -104,7 +109,8 @@
      * @param moduleref
      * @throws AxisFault
      */
-    public void engageModule(ModuleDescription moduleref , AxisConfiguration axisConfig) throws AxisFault {
+    public void engageModule(ModuleDescription moduleref , AxisConfiguration axisConfig)
+            throws AxisFault {
         if (moduleref == null) {
             return;
         }
@@ -181,7 +187,12 @@
         String opStr = operationName.getLocalPart();
 
         HashMap allOperations = this.getServiceInterface().getAllOperations();
-        return (OperationDescription) allOperations.get(opStr);
+        OperationDescription opeartion = (OperationDescription) allOperations.get(opStr);
+        if(opeartion == null ){
+            opeartion = (OperationDescription)wasaction_opeartionmap.get(
+                    operationName.getLocalPart());
+        }
+        return opeartion;
     }
 
     /*
@@ -481,7 +492,7 @@
      */
     public OperationDescription getOperationBySOAPAction(String soapAction) {
         if(soapAction == null || soapAction.equals("")){
-           return null;
+            return null;
         }
         Iterator iterator = this.getEndpoints().keySet().iterator();
         if (iterator.hasNext()) {
@@ -732,5 +743,12 @@
 
     public Map getMetadataBag() {
         return serviceimpl.getMetadataBag();
+    }
+
+    /**
+     * To add the was action paramater into has map so that was action based dispatch can support
+     */
+    public void addMapping(String mappingKey , OperationDescription operation){
+        wasaction_opeartionmap.put(mappingKey,operation);
     }
 }