You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by az...@apache.org on 2006/05/02 15:46:26 UTC

svn commit: r398939 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisSOAPServlet.java

Author: azeez
Date: Tue May  2 06:46:23 2006
New Revision: 398939

URL: http://svn.apache.org/viewcvs?rev=398939&view=rev
Log:
Changed AxisSOAPServlet to handle fault serialization


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

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisSOAPServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisSOAPServlet.java?rev=398939&r1=398938&r2=398939&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 Tue May  2 06:46:23 2006
@@ -17,6 +17,8 @@
 
 import org.apache.axis2.transport.http.util.SOAPUtil;
 import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.AxisFault;
 import org.apache.log4j.Logger;
 
 import javax.servlet.http.HttpServletRequest;
@@ -40,14 +42,20 @@
 
     protected void doPost(HttpServletRequest req,
                           HttpServletResponse resp) throws ServletException, IOException {
+
+        MessageContext msgCtx = null;
         try {
-            new SOAPUtil().processPostRequest(createMessageContext(req, resp),
+            msgCtx = createMessageContext(req, resp);
+            new SOAPUtil().processPostRequest(msgCtx,
                                               req,
                                               resp);
         } catch (Exception e) {
-//            e.printStackTrace();
             log.error(e);
-            throw new ServletException(e);
+            if (msgCtx != null) {
+                handleFault(msgCtx, resp.getOutputStream(), new AxisFault(e));
+            } else {
+                throw new ServletException(e);
+            }
         }
     }
 
@@ -60,7 +68,7 @@
     }
 
     public void init() throws ServletException {
-        if(this.servletConfig != null){
+        if (this.servletConfig != null) {
             init(this.servletConfig);
         }
     }