axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r678357 - in /webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http: CommonsHTTPTransportSender.java ServletBasedOutTransportInfo.java
Date Mon, 21 Jul 2008 06:09:12 GMT
Author: asankha
Date: Sun Jul 20 23:09:11 2008
New Revision: 678357

URL: http://svn.apache.org/viewvc?rev=678357&view=rev
Log:
backport of AXIS2-3887 fix to Axis2 1.4

Modified:
    webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
    webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/ServletBasedOutTransportInfo.java

Modified: webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=678357&r1=678356&r2=678357&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
(original)
+++ webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
Sun Jul 20 23:09:11 2008
@@ -41,6 +41,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.stream.FactoryConfigurationError;
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.MalformedURLException;
@@ -253,6 +254,12 @@
         if (transportInfo instanceof ServletBasedOutTransportInfo) {
             servletBasedOutTransportInfo =
                     (ServletBasedOutTransportInfo) transportInfo;
+
+            // if sending a fault, set HTTP status code to 500
+            if (msgContext.isFault()) {
+                servletBasedOutTransportInfo.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+            }
+
             Object customHeaders = msgContext.getProperty(HTTPConstants.HTTP_HEADERS);
             if (customHeaders != null) {
                 if (customHeaders instanceof List) {

Modified: webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/ServletBasedOutTransportInfo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/ServletBasedOutTransportInfo.java?rev=678357&r1=678356&r2=678357&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/ServletBasedOutTransportInfo.java
(original)
+++ webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/transport/http/ServletBasedOutTransportInfo.java
Sun Jul 20 23:09:11 2008
@@ -38,4 +38,8 @@
     public void addHeader(String headerName, String headerValue) {
         response.addHeader(headerName, headerValue);
     }
+
+    public void setStatus(int status) {
+        response.setStatus(status);
+    }
 }



Mime
View raw message