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 di...@apache.org on 2005/12/02 00:00:02 UTC

svn commit: r351510 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: deployment/ engine/

Author: dims
Date: Thu Dec  1 14:59:56 2005
New Revision: 351510

URL: http://svn.apache.org/viewcvs?rev=351510&view=rev
Log:
- Added debug traces for all dispatchers
- Set the axis service name in ServiceBuilder
- Move the location for RelatesTo based dispatch to AddressingBasedDispatcher


Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=351510&r1=351509&r2=351510&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java Thu Dec  1 14:59:56 2005
@@ -89,6 +89,12 @@
                 } else {
                     service.setAxisServiceName(descriptionElement.getText());
                 }
+            } else {
+                OMAttribute serviceNameatt = service_element.getAttribute(
+                        new QName(ATTNAME));
+                if(serviceNameatt != null) {
+                    service.setAxisServiceName(serviceNameatt.getAttributeValue());
+                }                
             }
 
             //processing servicewide modules which required to engage gloabbly

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java?rev=351510&r1=351509&r2=351510&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java Thu Dec  1 14:59:56 2005
@@ -22,6 +22,8 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.handlers.AbstractHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 
@@ -33,6 +35,7 @@
  * dispatch and returns without throwing an exception, in case, it fails.
  */
 public abstract class AbstractDispatcher extends AbstractHandler {
+    private Log log = LogFactory.getLog(getClass());
     /**
      * Field NAME
      */
@@ -57,30 +60,14 @@
      * @param msgctx
      * @throws org.apache.axis2.AxisFault
      */
-    public final void invoke(MessageContext msgctx) throws AxisFault {
-
-        // first check we can dispatch using the relates to
-        if (msgctx.getRelatesTo() != null) {
-            String relatesTo = msgctx.getRelatesTo().getValue();
-            if (relatesTo != null || "".equals(relatesTo)) {
-                OperationContext operationContext = msgctx.getConfigurationContext().getOperationContext(relatesTo);
-                if (operationContext != null) {
-                    msgctx.setAxisOperation(operationContext.getAxisOperation());
-                    msgctx.setOperationContext(operationContext);
-                    msgctx.setServiceContext((ServiceContext) operationContext.getParent());
-                    msgctx.setAxisService(((ServiceContext) operationContext.getParent()).getAxisService());
-                    msgctx.getAxisOperation().registerOperationContext(msgctx, operationContext);
-                    msgctx.setServiceGroupContextId(((ServiceGroupContext) msgctx.getServiceContext().getParent()).getId());
-                }
-            }
-            return;
-        }
-
-
+    public void invoke(MessageContext msgctx) throws AxisFault {
         AxisService axisService = msgctx.getAxisService();
         if (axisService == null) {
             axisService = findService(msgctx);
             if (axisService != null) {
+                if(log.isDebugEnabled()) {
+                    log.debug("Found AxisService : " + axisService.getAxisServiceName()) ;
+                }
                 msgctx.setAxisService(axisService);
                 // TODO Chinthaka : set the Service Group Context to the message Context
             }
@@ -89,6 +76,9 @@
         if (msgctx.getAxisService() != null && msgctx.getAxisOperation() == null) {
             AxisOperation axisOperation = findOperation(axisService, msgctx);
             if (axisOperation != null) {
+                if(log.isDebugEnabled()) {
+                    log.debug("Found AxisOperation : " + axisOperation.getName()) ;
+                }
                 msgctx.setAxisOperation(axisOperation);
             }
         }

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=351510&r1=351509&r2=351510&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 Thu Dec  1 14:59:56 2005
@@ -20,10 +20,15 @@
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.util.Utils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 
@@ -31,6 +36,7 @@
  * Dispatcher based on the WS-Addressing properties.
  */
 public class AddressingBasedDispatcher extends AbstractDispatcher implements AddressingConstants {
+    private Log log = LogFactory.getLog(getClass());
     /**
      * Field NAME
      */
@@ -42,17 +48,42 @@
         init(new HandlerDescription(NAME));
     }
 
+    /**
+     * 
+     * @param msgctx
+     * @throws org.apache.axis2.AxisFault
+     */
+    public void invoke(MessageContext msgctx) throws AxisFault {
+        // first check we can dispatch using the relates to
+        if (msgctx.getRelatesTo() != null) {
+            log.debug("Checking RelatesTo : " + msgctx.getRelatesTo());
+            String relatesTo = msgctx.getRelatesTo().getValue();
+            if (relatesTo != null || "".equals(relatesTo)) {
+                OperationContext operationContext = msgctx.getConfigurationContext().getOperationContext(relatesTo);
+                if (operationContext != null) {
+                    msgctx.setAxisOperation(operationContext.getAxisOperation());
+                    msgctx.setOperationContext(operationContext);
+                    msgctx.setServiceContext((ServiceContext) operationContext.getParent());
+                    msgctx.setAxisService(((ServiceContext) operationContext.getParent()).getAxisService());
+                    msgctx.getAxisOperation().registerOperationContext(msgctx, operationContext);
+                    msgctx.setServiceGroupContextId(((ServiceGroupContext) msgctx.getServiceContext().getParent()).getId());
+                }
+            }
+            return;
+        }
+        super.invoke(msgctx);
+    }
+    
     //TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
     public AxisOperation findOperation(AxisService service,
                                        MessageContext messageContext)
             throws AxisFault {
+        log.debug("Checking for Operation using WSAAction : " + messageContext.getWSAAction());
         String action = messageContext.getWSAAction();
         if (action != null) {
             QName operationName = new QName(action);
             return service.getOperation(operationName);
         }
-
-
         return null;
     }
 
@@ -62,6 +93,7 @@
         AxisService service = null;
         if (toEPR != null) {
             String address = toEPR.getAddress();
+            log.debug("Checking for Service using toEPR's address : " + address);
             if (Final.WSA_ANONYMOUS_URL.equals(address) || Submission.WSA_ANONYMOUS_URL.equals(address)) {
                 return null;
             }
@@ -69,6 +101,7 @@
 
             String[] values = Utils.parseRequestURLForServiceAndOperation(
                     address);
+            log.debug("Checking for Service using toEPR : " + values[0]);
             if (values[0] != null) {
                 serviceName = new QName(values[0]);
                 AxisConfiguration registry =

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java?rev=351510&r1=351509&r2=351510&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java Thu Dec  1 14:59:56 2005
@@ -23,6 +23,8 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.util.Utils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 
@@ -30,6 +32,7 @@
  * Dispatches the service based on the information from the target endpoint URL.
  */
 public class RequestURIBasedDispatcher extends AbstractDispatcher {
+    private Log log = LogFactory.getLog(getClass());
     /**
      * Field NAME
      */
@@ -43,6 +46,7 @@
     public AxisOperation findOperation(AxisService service,
                                        MessageContext messageContext)
             throws AxisFault {
+        log.debug("Checking for Operation using target endpoint uri fragment : " + operationName);
         if (operationName != null) {
             return service.getOperation(operationName);
         }
@@ -56,6 +60,7 @@
     public AxisService findService(MessageContext messageContext) throws AxisFault {
         EndpointReference toEPR = messageContext.getTo();
         if (toEPR != null) {
+            log.debug("Checking for Service using target endpoint address : " + toEPR.getAddress());
             String filePart = toEPR.getAddress();
             String[] values = Utils.parseRequestURLForServiceAndOperation(
                     filePart);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java?rev=351510&r1=351509&r2=351510&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java Thu Dec  1 14:59:56 2005
@@ -21,6 +21,8 @@
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 
@@ -28,6 +30,7 @@
  * Dispatches based on the SOAPAction.
  */
 public class SOAPActionBasedDispatcher extends AbstractDispatcher {
+    private Log log = LogFactory.getLog(getClass());
     /**
      * Field NAME
      */
@@ -44,6 +47,7 @@
             throws AxisFault {
 
         String action = messageContext.getSoapAction();
+        log.debug("Checking for Operation using SOAPAction : " + action);
         if (action != null) {
             AxisOperation op = service.getOperationBySOAPAction(action);
             if (op == null) {
@@ -62,6 +66,7 @@
      * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
      */
     public AxisService findService(MessageContext messageContext) throws AxisFault {
+        log.debug("Checking for Service using SOAPAction is a TODO item");
         return null;
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java?rev=351510&r1=351509&r2=351510&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java Thu Dec  1 14:59:56 2005
@@ -24,6 +24,8 @@
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMNamespace;
 import org.apache.axis2.util.Utils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 
@@ -32,6 +34,7 @@
  * the body.
  */
 public class SOAPMessageBodyBasedDispatcher extends AbstractDispatcher {
+    private Log log = LogFactory.getLog(getClass());
     /**
      * Field NAME
      */
@@ -53,6 +56,7 @@
         if (bodyFirstChild == null) {
             return null;
         } else {
+            log.debug("Checking for Operation using SOAP message body's first child's local name : " + bodyFirstChild.getLocalName());
             operationName = new QName(bodyFirstChild.getLocalName());
         }
 
@@ -69,6 +73,7 @@
             OMNamespace ns = bodyFirstChild.getNamespace();
             if (ns != null) {
                 String filePart = ns.getName();
+                log.debug("Checking for Service using SOAP message body's first child's namespace : " + filePart);
 
                 String[] values = Utils.parseRequestURLForServiceAndOperation(
                         filePart);