You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ro...@apache.org on 2007/09/13 20:27:27 UTC

svn commit: r575394 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http: HTTPWorker.java util/SOAPUtil.java

Author: rott
Date: Thu Sep 13 11:27:26 2007
New Revision: 575394

URL: http://svn.apache.org/viewvc?rev=575394&view=rev
Log:
Contributor:  Dustin Amrhein
Jira:  AXIS2-3171 - AxisServlet closes OutputStream too early in some instances

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java?rev=575394&r1=575393&r2=575394&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java Thu Sep 13 11:27:26 2007
@@ -299,21 +299,15 @@
         }
         
         // Finalize response
-        OperationContext operationContext = msgContext.getOperationContext();
-        Object isTwoChannel = null;
-        RequestResponseTransport requestResponseTransportControl = 
-            (RequestResponseTransport)msgContext.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
-        if (operationContext != null) {
-            isTwoChannel = operationContext.getProperty(Constants.DIFFERENT_EPR);
-        }
+        RequestResponseTransport requestResponseTransportControl =
+            (RequestResponseTransport) msgContext.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
 
-        if (TransportUtils.isResponseWritten(msgContext) || 
-                ((requestResponseTransportControl != null) &&
-                  requestResponseTransportControl.getStatus().
-                    equals(RequestResponseTransport.RequestResponseTransportStatus.SIGNALLED))) {
-            if ((isTwoChannel != null) && Constants.VALUE_TRUE.equals(isTwoChannel)) {
-                response.setStatus(HttpStatus.SC_ACCEPTED);
-            }
+        if (TransportUtils.isResponseWritten(msgContext)) {
+            if ((requestResponseTransportControl != null) 
+                    && 
+                    (requestResponseTransportControl.getStatus().equals(RequestResponseTransport.RequestResponseTransportStatus.SIGNALLED))) {
+                    response.setStatus(HttpStatus.SC_OK);
+            } 
         } else {
             response.setStatus(HttpStatus.SC_ACCEPTED);
         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java?rev=575394&r1=575393&r2=575394&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java Thu Sep 13 11:27:26 2007
@@ -24,6 +24,7 @@
 import org.apache.axis2.Constants;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.Handler.InvocationResponse;
 import org.apache.axis2.transport.TransportUtils;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.transport.http.HTTPTransportUtils;
@@ -64,7 +65,7 @@
             }
             String soapAction = request.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
             msgContext.setProperty(Constants.Configuration.CONTENT_TYPE, request.getContentType());
-            HTTPTransportUtils.processHTTPPostRequest(msgContext,
+            InvocationResponse ir = HTTPTransportUtils.processHTTPPostRequest(msgContext,
                                                       request.getInputStream(),
                                                       response.getOutputStream(),
                                                       request.getContentType(),
@@ -89,7 +90,7 @@
             if (parameter != null) {
                 closeReader = JavaUtils.isTrueExplicitly(parameter.getValue());
             }
-            if (closeReader) {
+            if (closeReader && !InvocationResponse.SUSPEND.equals(ir)) {
                 try {
                     ((StAXBuilder) msgContext.getEnvelope().getBuilder()).close();
                 } catch (Exception e) {



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