axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r480579 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http: AxisServlet.java CommonsHTTPTransportSender.java util/SOAPUtil.java
Date Wed, 29 Nov 2006 14:27:29 GMT
Author: dims
Date: Wed Nov 29 06:27:27 2006
New Revision: 480579

URL: http://svn.apache.org/viewvc?view=rev&rev=480579
Log:
* better version of the fix in 479513
  - pick up the parameter from axis2.xml
  - read the value just once in AxisServlet
  - Add the same logic in SOAPUtil.java
* Throw in some log.debug()'s (unrelated to 479513)


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java?view=diff&rev=480579&r1=480578&r2=480579
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
Wed Nov 29 06:27:27 2006
@@ -78,7 +78,7 @@
     protected boolean disableSeperateEndpointForREST = false;
     private static final String LIST_SERVICES_SUFIX = "/services/listServices";
     private static final String LIST_FAUKT_SERVICES_SUFIX = "/services/ListFaultyServices";
-
+    private boolean closeReader = true;
 
     protected MessageContext
     createAndSetInitialParamsToMsgCtxt(HttpServletResponse resp,
@@ -295,12 +295,6 @@
                 }
             }
         }
-        boolean closeReader = true;
-        String closeReaderParameter = servletConfig.getInitParameter("axis2.close.reader");
-        if (closeReaderParameter != null) {
-            closeReaderParameter = closeReaderParameter.trim();
-            closeReader = JavaUtils.isTrue(closeReaderParameter);
-        }
         if(closeReader){
             try {
                 ((StAXBuilder)msgContext.getEnvelope().getBuilder()).close();
@@ -369,6 +363,11 @@
             disableSeperateEndpointForREST = !JavaUtils.isFalseExplicitly(parameter.getValue());
         }
 
+        // Should we close the reader(s)
+        parameter = axisConfiguration.getParameter("axis2.close.reader");
+        if (parameter != null) {
+            closeReader = JavaUtils.isTrueExplicitly(parameter.getValue());
+        }
     }
 
     public void init() throws ServletException {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?view=diff&rev=480579&r1=480578&r2=480579
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
Wed Nov 29 06:27:27 2006
@@ -218,10 +218,13 @@
                                 Constants.VALUE_TRUE);
             }
         } catch (XMLStreamException e) {
+            log.debug(e);
             throw new AxisFault(e);
         } catch (FactoryConfigurationError e) {
+            log.debug(e);
             throw new AxisFault(e);
         } catch (IOException e) {
+            log.debug(e);
             throw new AxisFault(e);
         }
         return InvocationResponse.CONTINUE;
@@ -334,10 +337,13 @@
 
             sender.send(messageContext, dataout, url, soapActionString);
         } catch (MalformedURLException e) {
+            log.debug(e);
             throw new AxisFault(e);
         } catch (HttpException e) {
+            log.debug(e);
             throw new AxisFault(e);
         } catch (IOException e) {
+            log.debug(e);
             throw new AxisFault(e);
         }
     }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java?view=diff&rev=480579&r1=480578&r2=480579
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java
Wed Nov 29 06:27:27 2006
@@ -17,10 +17,15 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.transport.http.HTTPTransportUtils;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.builder.StAXBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -30,6 +35,7 @@
  *
  */
 public class SOAPUtil {
+    private static final Log log = LogFactory.getLog(SOAPUtil.class);
 
     public SOAPUtil() {
     }
@@ -69,6 +75,19 @@
 
             if ((contextWritten == null) || !Constants.VALUE_TRUE.equals(contextWritten))
{
                 response.setStatus(HttpServletResponse.SC_ACCEPTED);
+            }
+
+            boolean closeReader = true;
+            Parameter parameter = msgContext.getConfigurationContext().getAxisConfiguration().getParameter("axis2.close.reader");
+            if (parameter != null) {
+                closeReader = JavaUtils.isTrueExplicitly(parameter.getValue());
+            }
+            if (closeReader) {
+                try {
+                    ((StAXBuilder) msgContext.getEnvelope().getBuilder()).close();
+                } catch (Exception e) {
+                    log.debug(e);
+                }
             }
             return true;
         } catch (AxisFault axisFault) {



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