geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1101480 - /geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
Date Tue, 10 May 2011 14:39:51 GMT
Author: xuhaihong
Date: Tue May 10 14:39:51 2011
New Revision: 1101480

URL: http://svn.apache.org/viewvc?rev=1101480&view=rev
Log:
Set the response status code correctly, some codes are refered from AxisServlet from axis2-http-transport

Modified:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?rev=1101480&r1=1101479&r2=1101480&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
Tue May 10 14:39:51 2011
@@ -66,6 +66,7 @@ import org.apache.axis2.jaxws.server.JAX
 import org.apache.axis2.jaxws.server.endpoint.lifecycle.factory.EndpointLifecycleManagerFactory;
 import org.apache.axis2.transport.OutTransportInfo;
 import org.apache.axis2.transport.RequestResponseTransport;
+import org.apache.axis2.transport.TransportUtils;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.transport.http.HTTPTransportReceiver;
 import org.apache.axis2.transport.http.HTTPTransportUtils;
@@ -334,24 +335,25 @@ public abstract class Axis2WebServiceCon
             throw new UnsupportedOperationException("[" + request.getMethod() + " ] method
not supported");
         }
 
-        // Finalize response
-        OperationContext operationContext = msgContext.getOperationContext();
-        Object contextWritten = null;
-        Object isTwoChannel = null;
-        if (operationContext != null) {
-            contextWritten = operationContext.getProperty(Constants.RESPONSE_WRITTEN);
-            isTwoChannel = operationContext.getProperty(Constants.DIFFERENT_EPR);
-        }
-
-        if ((contextWritten != null) && Constants.VALUE_TRUE.equals(contextWritten))
{
+        // Finalize response        
+        if (TransportUtils.isResponseWritten(msgContext)) {
+            OperationContext operationContext = msgContext.getOperationContext();
+            Object isTwoChannel = null;
+            if (operationContext != null) {
+                isTwoChannel = operationContext.getProperty(Constants.DIFFERENT_EPR);
+            }
             if ((isTwoChannel != null) && Constants.VALUE_TRUE.equals(isTwoChannel))
{
                 response.setStatusCode(HttpURLConnection.HTTP_ACCEPTED);
                 return;
             }
-            response.setStatusCode(HttpURLConnection.HTTP_OK);
         } else {
-            response.setStatusCode(HttpURLConnection.HTTP_ACCEPTED);
+            RequestResponseTransport requestResponseTransport = (RequestResponseTransport)
msgContext.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
+            if (requestResponseTransport != null && requestResponseTransport.getStatus()
!= RequestResponseTransport.RequestResponseTransportStatus.SIGNALLED) {
+                response.setStatusCode(HttpURLConnection.HTTP_ACCEPTED);
+                return;
+            }
         }
+        response.setStatusCode(HttpURLConnection.HTTP_OK);
     }
 
     public void destroy() {



Mime
View raw message