axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r419526 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/context/ core/src/org/apache/axis2/description/ core/src/org/apache/axis2/engine/ core/test/org/apache/axis2/context/ integration/test/org/apache/axis2/engine/
Date Thu, 06 Jul 2006 11:36:40 GMT
Author: deepal
Date: Thu Jul  6 04:36:40 2006
New Revision: 419526

URL: http://svn.apache.org/viewvc?rev=419526&view=rev
Log:
- client running inside a server had a problem when invoking the service in async manner 
- overriding of operations context (due to messageid is equal)

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
    webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java?rev=419526&r1=419525&r2=419526&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
Thu Jul  6 04:36:40 2006
@@ -220,11 +220,14 @@
     /**
      * Gets a OperationContext given a Message ID.
      *
-     * @param messageID
+     * @param msgctx
      * @return Returns OperationContext <code>OperationContext<code>
      */
-    public OperationContext getOperationContext(String messageID) {
-        return (OperationContext) this.operationContextMap.get(messageID);
+    public OperationContext getOperationContext(MessageContext msgctx) {
+        String id = msgctx.getRelatesTo().getValue() + ":" +
+                msgctx.getAxisOperation().getMessageExchangePattern();
+        //String messageID
+        return (OperationContext) this.operationContextMap.get(id);
     }
 
     public Map getOperationContextMap() {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java?rev=419526&r1=419525&r2=419526&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
Thu Jul  6 04:36:40 2006
@@ -105,7 +105,8 @@
             MessageContext messageContext = (MessageContext) msgContexts.next();
 
             if ((null != messageContext) && (operationContextMap != null)) {
-                operationContextMap.remove(messageContext.getMessageID());
+                operationContextMap.remove(messageContext.getMessageID() + ":"
+                        + getAxisOperation().getMessageExchangePattern());
             }
         }
     }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java?rev=419526&r1=419525&r2=419526&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
Thu Jul  6 04:36:40 2006
@@ -34,11 +34,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Set;
+import java.util.*;
 
 public abstract class AxisOperation extends AxisDescription
         implements WSDLConstants {
@@ -271,8 +267,8 @@
         operation.setWsamappingList(axisOperation.getWsamappingList());
         operation.setOutputAction(axisOperation.getOutputAction());
         String[] faultActionNames = axisOperation.getFaultActionNames();
-        for(int i=0;i<faultActionNames.length;i++){
-            operation.addFaultAction(faultActionNames[i],axisOperation.getFaultAction(faultActionNames[i]));
+        for (int i = 0; i < faultActionNames.length; i++) {
+            operation.addFaultAction(faultActionNames[i], axisOperation.getFaultAction(faultActionNames[i]));
         }
         operation.setRemainingPhasesInFlow(axisOperation.getRemainingPhasesInFlow());
         operation.setPhasesInFaultFlow(axisOperation.getPhasesInFaultFlow());
@@ -306,10 +302,10 @@
             ConfigurationContext configContext = msgContext.getConfigurationContext();
 
             operationContext =
-                    configContext.getOperationContext(msgContext.getRelatesTo().getValue());
+                    configContext.getOperationContext(msgContext);
 
             if (null == operationContext) {
-                throw new AxisFault("cannot Correalte Msg " + this.getName().toString() +"
for the " +  msgContext.getRelatesTo().getValue());
+                throw new AxisFault("cannot Correalte Msg " + this.getName().toString() +
" for the " + msgContext.getRelatesTo().getValue());
             }
         }
 
@@ -353,7 +349,7 @@
             ConfigurationContext configContext = msgContext.getConfigurationContext();
 
             operationContext =
-                    configContext.getOperationContext(msgContext.getRelatesTo().getValue());
+                    configContext.getOperationContext(msgContext);
 
             if (null == operationContext) {
                 throw new AxisFault(Messages.getMessage("cannotCorrelateMsg",
@@ -369,11 +365,12 @@
     public void registerOperationContext(MessageContext msgContext,
                                          OperationContext operationContext)
             throws AxisFault {
-        msgContext.getConfigurationContext().registerOperationContext(msgContext.getMessageID(),
+        msgContext.setAxisOperation(this);
+        msgContext.getConfigurationContext().registerOperationContext(msgContext.getMessageID()
+                + ":" + this.getMessageExchangePattern(),
                 operationContext);
         operationContext.addMessageContext(msgContext);
         msgContext.setOperationContext(operationContext);
-
         if (operationContext.isComplete()) {
             operationContext.cleanup();
         }
@@ -587,7 +584,7 @@
         }
         return result;
     }
-    
+
     public boolean isEngaged(QName moduleName) {
         Iterator engagedModuleItr = engagedModules.iterator();
         while (engagedModuleItr.hasNext()) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java?rev=419526&r1=419525&r2=419526&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
Thu Jul  6 04:36:40 2006
@@ -272,13 +272,15 @@
             //HTTP
             mc.setProperty(MessageContext.TRANSPORT_NON_BLOCKING, Boolean.TRUE);
             AxisEngine engine = new AxisEngine(cc);
+            sc.getAxisService().mapActionToOperation(mc.getSoapAction(),axisOp);
+            mc.getConfigurationContext().registerOperationContext(mc.getMessageID(), oc);
             engine.send(mc);
         } else {
             if (block) {
                 // Send the SOAP Message and receive a response
                 MessageContext response = send(mc);
                 // check for a fault and return the result
-                if (response!=null) {
+                if (response != null) {
                     SOAPEnvelope resEnvelope = response.getEnvelope();
                     if (resEnvelope.getBody().hasFault()) {
                         SOAPFault soapFault = resEnvelope.getBody().getFault();
@@ -417,7 +419,7 @@
                 // send the request and wait for reponse
                 MessageContext response = send(msgctx);
                 // call the callback
-                if (response!=null) {
+                if (response != null) {
                     SOAPEnvelope resenvelope = response.getEnvelope();
                     SOAPBody body = resenvelope.getBody();
                     if (body.hasFault()) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java?rev=419526&r1=419525&r2=419526&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 Jul  6 04:36:40 2006
@@ -44,7 +44,7 @@
      */
     public static final QName NAME = new QName("http://ws.apache.org/axis2/",
             "AddressingBasedDispatcher");
-	private static final Log log = LogFactory.getLog(AddressingBasedDispatcher.class);
+    private static final Log log = LogFactory.getLog(AddressingBasedDispatcher.class);
 
     // TODO this logic needed to be improved, as the Dispatching is almost guaranteed to
fail
     public AxisOperation findOperation(AxisService service, MessageContext messageContext)
@@ -68,7 +68,7 @@
 
         if (toEPR != null) {
             String address = toEPR.getAddress();
-            log.debug(Messages.getMessage("checkingserviceforepr",address));
+            log.debug(Messages.getMessage("checkingserviceforepr", address));
 
             if (Final.WSA_ANONYMOUS_URL.equals(address)
                     || Submission.WSA_ANONYMOUS_URL.equals(address)) {
@@ -76,13 +76,13 @@
             }
 
             QName serviceName;
-            String[] values = Utils.parseRequestURLForServiceAndOperation(address ,
+            String[] values = Utils.parseRequestURLForServiceAndOperation(address,
                     messageContext.getConfigurationContext().getServicePath());
             if (values == null) {
                 return null;
             }
 
-            log.debug(Messages.getMessage("checkingserviceforepr",values[0]));
+            log.debug(Messages.getMessage("checkingserviceforepr", values[0]));
 
             if (values[0] != null) {
                 serviceName = new QName(values[0]);
@@ -108,7 +108,7 @@
     public void invoke(MessageContext msgctx) throws AxisFault {
 
         // first check we can dispatch using the relates to
-        if (msgctx.getRelatesTo() != null) {
+        if (msgctx.getRelatesTo() != null && msgctx.getAxisOperation() != null) {
             String relatesTo = msgctx.getRelatesTo().getValue();
 
             log.debug(Messages.getMessage("checkingrelatesto",
@@ -116,7 +116,7 @@
 
             if ((relatesTo != null) || "".equals(relatesTo)) {
                 OperationContext operationContext =
-                        msgctx.getConfigurationContext().getOperationContext(relatesTo);
+                        msgctx.getConfigurationContext().getOperationContext(msgctx);
 
                 if (operationContext != null) {
                     msgctx.setAxisOperation(operationContext.getAxisOperation());

Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java?rev=419526&r1=419525&r2=419526&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java
(original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java
Thu Jul  6 04:36:40 2006
@@ -58,6 +58,7 @@
         messageContext2.setMessageID(UUIDGenerator.getUUID());
         messageContext2.getOptions().addRelatesTo(
                 new RelatesTo(messageContext1.getMessageID()));
+        messageContext2.setAxisOperation(axisOperation);
         OperationContext operationContext2 = axisOperation
                 .findOperationContext(messageContext2, sessionContext);
         assertEquals(operationContext1, operationContext2);

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java?rev=419526&r1=419525&r2=419526&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
Thu Jul  6 04:36:40 2006
@@ -28,6 +28,7 @@
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.ConfigurationContext;



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message