rsitze 2002/06/03 15:30:15
Modified: java/src/org/apache/axis AxisFault.java
Log:
Added method to determine HttpServletResponse status code for axis fault
Revision Changes Path
1.44 +9 -0 xml-axis/java/src/org/apache/axis/AxisFault.java
Index: AxisFault.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisFault.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- AxisFault.java 30 May 2002 03:06:06 -0000 1.43
+++ AxisFault.java 3 Jun 2002 22:30:15 -0000 1.44
@@ -73,6 +73,7 @@
import java.util.Vector;
import javax.xml.rpc.namespace.QName;
+import javax.servlet.http.HttpServletResponse;
/**
* An exception which maps cleanly to a SOAP fault.
@@ -299,6 +300,14 @@
for (int i=0; i<result.length; i++)
result[i] = (Element) faultDetails.elementAt(i);
return result;
+ }
+
+ public int getHttpServletResponseStatus() {
+ // Should really be doing this with explicit AxisFault
+ // subclasses... --Glen
+ return getFaultCode().getLocalPart().equals("Server.Unauthorized")
+ ? HttpServletResponse.SC_UNAUTHORIZED
+ : HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
}
public void output(SerializationContext context) throws Exception {