axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From az...@apache.org
Subject svn commit: r892682 - in /webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local: LocalTransportReceiver.java LocalTransportSender.java
Date Mon, 21 Dec 2009 04:09:58 GMT
Author: azeez
Date: Mon Dec 21 04:09:58 2009
New Revision: 892682

URL: http://svn.apache.org/viewvc?rev=892682&view=rev
Log:
Set the original HttpServletRequest in the case of the local transport


Modified:
    webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportReceiver.java
    webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportSender.java

Modified: webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportReceiver.java?rev=892682&r1=892681&r2=892682&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportReceiver.java
Mon Dec 21 04:09:58 2009
@@ -31,6 +31,7 @@
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.util.MessageContextBuilder;
 
 import javax.xml.stream.XMLStreamException;
@@ -41,6 +42,7 @@
 public class LocalTransportReceiver {
     public static ConfigurationContext CONFIG_CONTEXT;
     private ConfigurationContext confContext;
+    private MessageContext inMessageContext;
 
     public LocalTransportReceiver(ConfigurationContext configContext) {
         confContext = configContext;
@@ -50,6 +52,18 @@
         this(CONFIG_CONTEXT);
     }
 
+    public void processMessage(MessageContext inMessageContext,
+                               InputStream in,
+                               OutputStream response) throws AxisFault {
+        if (this.confContext == null) {
+            this.confContext = inMessageContext.getConfigurationContext();
+        }
+        this.inMessageContext = inMessageContext;
+        EndpointReference to =  inMessageContext.getTo();
+        String action = inMessageContext.getOptions().getAction();
+        processMessage(in, to, action, response);
+    }
+
     public void processMessage(ConfigurationContext configurationContext,
                                InputStream in,
                                EndpointReference to,
@@ -64,6 +78,11 @@
     public void processMessage(InputStream in, EndpointReference to, String action, OutputStream
response)
             throws AxisFault {
         MessageContext msgCtx = confContext.createMessageContext();
+        if (inMessageContext != null) {
+            msgCtx.setProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST,
+                               inMessageContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST));
+        }
+
         TransportInDescription tIn = confContext.getAxisConfiguration().getTransportIn(
                 Constants.TRANSPORT_LOCAL);
         TransportOutDescription tOut = confContext.getAxisConfiguration().getTransportOut(

Modified: webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportSender.java?rev=892682&r1=892681&r2=892682&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportSender.java
(original)
+++ webservices/axis2/trunk/java/modules/transport/local/src/org/apache/axis2/transport/local/LocalTransportSender.java
Mon Dec 21 04:09:58 2009
@@ -101,11 +101,7 @@
             ByteArrayOutputStream response = new ByteArrayOutputStream();
 
             LocalTransportReceiver localTransportReceiver = new LocalTransportReceiver(this);
-             localTransportReceiver.processMessage(msgContext.getConfigurationContext(),
-                                                  in,
-                                                  msgContext.getTo(),
-                                                  msgContext.getOptions().getAction(),
-                                                  response);
+            localTransportReceiver.processMessage(msgContext, in, response);
 
             in.close();
             out.close();



Mime
View raw message