You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/09/14 12:57:23 UTC

svn commit: r280820 - in /webservices/axis2/trunk/java/modules/core: src/org/apache/axis2/engine/AddressingBasedDispatcher.java src/org/apache/axis2/engine/AxisConfigurationImpl.java test/org/apache/axis2/engine/EnginePausingTest.java

Author: chinthaka
Date: Wed Sep 14 03:57:03 2005
New Revision: 280820

URL: http://svn.apache.org/viewcvs?rev=280820&view=rev
Log:
Fixing AddressingBasedDispatcher

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
    webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java?rev=280820&r1=280819&r2=280820&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java Wed Sep 14 03:57:03 2005
@@ -43,6 +43,7 @@
     public void initDispatcher() {
         init(new HandlerDescription(NAME));
     }
+
     //TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
     public OperationDescription findOperation(ServiceDescription service,
                                               MessageContext messageContext)
@@ -61,22 +62,17 @@
     public ServiceDescription findService(MessageContext messageContext) throws AxisFault {
         EndpointReference toEPR = messageContext.getTo();
         ServiceDescription service = null;
-        if (toEPR != null) {
-            QName serviceName = new QName(toEPR.getAddress());
-            service =
-                    messageContext.getSystemContext().getAxisConfiguration()
-                            .getService(serviceName.getLocalPart());
-            if (service == null) {
-                String filePart = toEPR.getAddress();
-                String[] values = Utils.parseRequestURLForServiceAndOperation(
-                        filePart);
-                if (values[0] != null) {
-                    serviceName = new QName(values[0]);
-                    AxisConfiguration registry =
-                            messageContext.getSystemContext().getAxisConfiguration();
-                    return registry.getService(serviceName.getLocalPart());
-                }
-            }
+        QName serviceName = new QName(toEPR.getAddress());
+
+        String filePart = toEPR.getAddress();
+        String[] values = Utils.parseRequestURLForServiceAndOperation(
+                filePart);
+        if (values[0] != null) {
+            serviceName = new QName(values[0]);
+            AxisConfiguration registry =
+                    messageContext.getSystemContext().getAxisConfiguration();
+            return registry.getService(serviceName.getLocalPart());
+
         }
         return service;
     }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java?rev=280820&r1=280819&r2=280820&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java Wed Sep 14 03:57:03 2005
@@ -16,8 +16,8 @@
 package org.apache.axis2.engine;
 
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.InstanceDispatcher;
 import org.apache.axis2.Constants;
+import org.apache.axis2.InstanceDispatcher;
 import org.apache.axis2.deployment.DeploymentEngine;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.deployment.util.PhasesInfo;
@@ -270,12 +270,12 @@
         String [] nameParts = splitServiceName(name);
         ServiceGroupDescription sg = getServiceGroup(nameParts[0]);
         if(sg == null){
-            throw new AxisFault("Service Not Found : " + name);
+            return null;
         } else {
             String servicName = nameParts[1];
             ServiceDescription service = sg.getService(new QName(servicName));
             if(service == null){
-                throw new AxisFault("Service Not Found : " + name);
+                return null;
             } else {
                 return  service;
             }

Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java?rev=280820&r1=280819&r2=280820&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java (original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java Wed Sep 14 03:57:03 2005
@@ -127,7 +127,8 @@
 
     public void testReceive() throws Exception {
         mc.setTo(
-                new EndpointReference("axis/services/NullService/DummyOp"));
+                new EndpointReference("axis2/services/NullService"));
+        mc.setWSAAction("DummyOp");
         AxisEngine engine = new AxisEngine(engineContext);
         engine.receive(mc);
         assertEquals(executedHandlers.size(), 14);