axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r164030 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/engine/AxisEngine.java core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java samples/test/org/apache/axis/integration/UtilServer.java
Date Thu, 21 Apr 2005 10:41:33 GMT
Author: hemapani
Date: Thu Apr 21 03:41:31 2005
New Revision: 164030

URL: http://svn.apache.org/viewcvs?rev=164030&view=rev
Log:
add URL based diaptacher to pick the service from URL

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java?rev=164030&r1=164029&r2=164030&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java Thu
Apr 21 03:41:31 2005
@@ -152,6 +152,7 @@
             if (context.isServerSide()) {
                 //This chain is the default Service diaptacher, the users may opt to overide
this by 
                 //adding an Handlers to the DispatchPhase. 
+                dispatchPhase.addHandler(new RequestURIBasedDispatcher());
                 AddressingBasedDispatcher dispatcher =
                     new AddressingBasedDispatcher();
                 dispatchPhase.addHandler(dispatcher);

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java?rev=164030&r1=164029&r2=164030&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java
Thu Apr 21 03:41:31 2005
@@ -18,23 +18,24 @@
 import javax.xml.namespace.QName;
 
 import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.context.EngineContext;
 import org.apache.axis.context.MessageContext;
-import org.apache.axis.context.OperationContext;
 import org.apache.axis.context.ServiceContext;
-import org.apache.axis.description.AxisOperation;
 import org.apache.axis.description.AxisService;
 import org.apache.axis.description.HandlerMetadata;
 import org.apache.axis.handlers.AbstractHandler;
-import org.apache.wsdl.WSDLService;
 
 /**
  * Class Dispatcher
  */
-public class RequestURIBasedDispatcher extends AbstractHandler implements Handler {
+public class RequestURIBasedDispatcher
+    extends AbstractHandler
+    implements Handler {
     /**
      * Field NAME
      */
-    public static final QName NAME = new QName("http://axis.ws.apache.org", "RequestURIBasedDispatcher");
+    public static final QName NAME =
+        new QName("http://axis.ws.apache.org", "RequestURIBasedDispatcher");
     private AxisService service;
 
     /**
@@ -60,35 +61,26 @@
             int index = filePart.lastIndexOf(URI_ID_STRING);
             String serviceStr = null;
             if (index > 0) {
-                serviceStr = filePart.substring(index + URI_ID_STRING.length() + 1);
-                EngineConfiguration registry = msgctx.getEngineContext().getEngineConfig();
+                serviceStr =
+                    filePart.substring(index + URI_ID_STRING.length() + 1);
+
+                EngineContext engineContext = msgctx.getEngineContext();
                 QName serviceName = new QName(serviceStr);
-                service = registry.getService(serviceName);
-                ServiceContext serviceContext = new ServiceContext(service);
-                if (service != null) {
-                    msgctx.setServiceContext(serviceContext);
-                    msgctx.setMessageStyle(service.getStyle());
-                } else {
-                    throw new AxisFault("Service " + serviceName + " is not found");
-                }
+                ServiceContext serviceContext =
+                    engineContext.getService(serviceName);
+                if (serviceContext == null) {
+                    EngineConfiguration registry =
+                        msgctx.getEngineContext().getEngineConfig();
+                    service = registry.getService(serviceName);
+                    if (service != null) {
+                        serviceContext = new ServiceContext(service);
+                    }
 
-            } else {
-                throw new AxisFault("Both the URI and SOAP_ACTION are Null");
-            }
-
-            if (WSDLService.STYLE_DOC.equals(msgctx.getMessageStyle())) {
-                String soapAction = (String) msgctx.getProperty(MessageContext.SOAP_ACTION);
-                if (soapAction != null) {
-                    soapAction = soapAction.replace('"', ' ').trim();
                 }
-
-                if (soapAction != null && soapAction.trim().length() > 0) {
-                    QName operationName = new QName(soapAction);
-                    AxisOperation op = service.getOperation(operationName);
-                    if (op != null) {
-                        OperationContext opContext = new OperationContext(op);
-                        msgctx.setOperationContext(opContext);
-                    }
+                if (serviceContext != null) {
+                    msgctx.setServiceContext(serviceContext);
+                    msgctx.setMessageStyle(
+                        serviceContext.getServiceConfig().getStyle());
                 }
             }
         } else {

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java?rev=164030&r1=164029&r2=164030&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java
(original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java
Thu Apr 21 03:41:31 2005
@@ -16,6 +16,7 @@
  
 package org.apache.axis.integration;
 
+import java.io.File;
 import java.net.ServerSocket;
 
 import javax.xml.namespace.QName;
@@ -49,8 +50,10 @@
         if (count == 0) {
             Class erClass = Class.forName("org.apache.axis.deployment.EngineRegistryFactoryImpl");
             EngineRegistryFactory erfac = (EngineRegistryFactory)erClass.newInstance();
-            EngineContext er = 
-                erfac.createEngineRegistry("target/test-resources/samples/");
+            
+            File file = new File("modules/samples/target/test-resources/samples");
+            System.out.println(new File(file,"server.xml").exists());
+            EngineContext er = erfac.createEngineRegistry(file.getAbsolutePath());
             try {
                 Thread.sleep(2000);
             } catch (InterruptedException e1) {



Mime
View raw message