axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidills...@apache.org
Subject svn commit: r430071 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http: AxisSOAPServlet.java AxisServlet.java server/DefaultHttpServiceProcessor.java
Date Wed, 09 Aug 2006 15:16:01 GMT
Author: davidillsley
Date: Wed Aug  9 08:16:01 2006
New Revision: 430071

URL: http://svn.apache.org/viewvc?rev=430071&view=rev
Log:
Fix for remainder AXIS2-741
Now HTTP 202's on back channel if fault is redirected.

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisSOAPServlet.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisSOAPServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisSOAPServlet.java?rev=430071&r1=430070&r2=430071&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisSOAPServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisSOAPServlet.java
Wed Aug  9 08:16:01 2006
@@ -16,12 +16,14 @@
 package org.apache.axis2.transport.http;
 
 import org.apache.axis2.transport.http.util.SOAPUtil;
+import org.apache.axis2.addressing.AddressingHelper;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.AxisFault;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.http.StatusLine;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -54,7 +56,12 @@
         } catch (Exception e) {
             log.error(e);
             if (msgCtx != null) {
-                resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                // If the fault is not going along the back channel we should be 202ing
+                if(AddressingHelper.isFaultRedirected(msgCtx)){
+                    resp.setStatus(HttpServletResponse.SC_ACCEPTED);
+                }else{
+                    resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                }
                 handleFault(msgCtx, resp.getOutputStream(), new AxisFault(e));
             } else {
                 throw new ServletException(e);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java?rev=430071&r1=430070&r2=430071&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
Wed Aug  9 08:16:01 2006
@@ -19,6 +19,7 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingHelper;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
@@ -170,7 +171,12 @@
             log.error(t);
             if (msgContext != null) {
                 try {
-                    res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                    // If the fault is not going along the back channel we should be 202ing
+                    if(AddressingHelper.isFaultRedirected(msgContext)){
+                        res.setStatus(HttpServletResponse.SC_ACCEPTED);
+                    }else{
+                        res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                    }
                     handleFault(msgContext, out, new AxisFault(t.toString(), t));
                 } catch (AxisFault e2) {
                     log.info(e2);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java?rev=430071&r1=430070&r2=430071&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/server/DefaultHttpServiceProcessor.java
Wed Aug  9 08:16:01 2006
@@ -37,6 +37,7 @@
 
 import org.apache.axis2.Constants;
 import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.axis2.addressing.AddressingHelper;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.SessionContext;
@@ -191,15 +192,23 @@
                 msgContext.setProperty(Constants.OUT_TRANSPORT_INFO, outbuffer);
 
                 MessageContext faultContext = engine.createFaultMessageContext(msgContext,
e);
-
-                response.setStatusLine(new StatusLine(ver, 500, "Internal server error"));
+                // If the fault is not going along the back channel we should be 202ing
+                if(AddressingHelper.isFaultRedirected(msgContext)){
+                    response.setStatusLine(new StatusLine(ver, 202, "Accepted"));
+                }else{
+                    response.setStatusLine(new StatusLine(ver, 500, "Internal server error"));
+                }
                 engine.sendFault(faultContext);
                 response.setEntity(outbuffer);
             } catch (Exception ex) {
-                response.setStatusLine(new StatusLine(ver, 500, "Internal server error"));
-                StringEntity entity = new StringEntity(ex.getMessage());
-                entity.setContentType("text/plain");
-                response.setEntity(entity);
+                if(AddressingHelper.isFaultRedirected(msgContext)){
+                    response.setStatusLine(new StatusLine(ver, 202, "Accepted"));
+                }else{
+                    response.setStatusLine(new StatusLine(ver, 500, "Internal server error"));
+                    StringEntity entity = new StringEntity(ex.getMessage());
+                    entity.setContentType("text/plain");
+                    response.setEntity(entity);
+                }
             }
         }
         



---------------------------------------------------------------------
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