synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r534813 - /webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2Sender.java
Date Thu, 03 May 2007 12:12:54 GMT
Author: asankha
Date: Thu May  3 05:12:53 2007
New Revision: 534813

URL: http://svn.apache.org/viewvc?view=rev&rev=534813
Log:
fix SYNAPSE-93 for http/s 202 Accepted with the non-blocking transport

The fix involves creating a dummy message context with an empty SOAP envelope and passing
it back to Synapse as the response received. Synapse needs to now <send/> this message
back to the client, in order to write a 202 Accepted back to its client. If the client <->
synapse transport is anything other than http/s, this dummy message would be dropped - e.g.
for JMS

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2Sender.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2Sender.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2Sender.java?view=diff&rev=534813&r1=534812&r2=534813
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2Sender.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2Sender.java
Thu May  3 05:12:53 2007
@@ -20,6 +20,7 @@
 package org.apache.synapse.core.axis2;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.transport.nhttp.NhttpConstants;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.commons.logging.Log;
@@ -61,8 +62,16 @@
 
     public static void sendBack(org.apache.synapse.MessageContext smc) {
 
-        MessageContext messageContext = ((Axis2MessageContext) smc).
-                getAxis2MessageContext();
+        MessageContext messageContext = ((Axis2MessageContext) smc).getAxis2MessageContext();
+
+        // if this is a dummy 202 Accepted message meant only for the http/s transports
+        // prevent it from going into any other transport sender
+        if (Boolean.TRUE.equals(messageContext.getProperty(NhttpConstants.SC_ACCEPTED)) &&
+            messageContext.getTransportOut() != null &&
+            !messageContext.getTransportOut().getName().startsWith("http")) {
+                return;
+        }
+
         AxisEngine ae = new AxisEngine(messageContext.getConfigurationContext());
 
         try {



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


Mime
View raw message