axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r478945 - in /webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2: engine/Phase.java transport/TransportUtils.java transport/http/HTTPTransportUtils.java
Date Fri, 24 Nov 2006 19:08:50 GMT
Author: dims
Date: Fri Nov 24 11:08:48 2006
New Revision: 478945

URL: http://svn.apache.org/viewvc?view=rev&rev=478945
Log:
yet another Fix for AXIS2-1769 for performance

Modified:
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/Phase.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/Phase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/Phase.java?view=diff&rev=478945&r1=478944&r2=478945
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/Phase.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/Phase.java
Fri Nov 24 11:08:48 2006
@@ -90,6 +90,8 @@
         this(null);
     }
 
+    public static boolean isDebugEnabled = log.isDebugEnabled();
+    
     /**
      * Constructor Phase.
      *
@@ -355,7 +357,6 @@
      * @throws org.apache.axis2.AxisFault
      */
     public final InvocationResponse invoke(MessageContext msgctx) throws AxisFault {
-        boolean isDebugEnabled = log.isDebugEnabled();
         if (isDebugEnabled) {
             log.debug("Checking pre-condition for Phase \"" + phaseName + "\"");
         }

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?view=diff&rev=478945&r1=478944&r2=478945
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Fri Nov 24 11:08:48 2006
@@ -161,10 +161,6 @@
             value = value.replaceAll("\"", "");
         }
 
-        if ("null".equalsIgnoreCase(value)) {
-            return null;
-        }
-
         return value.trim();
     }
 

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?view=diff&rev=478945&r1=478944&r2=478945
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
Fri Nov 24 11:08:48 2006
@@ -156,10 +156,15 @@
         }
     }
 
+    private static final int VERSION_UNKNOWN = 0;
+    private static final int VERSION_SOAP11 = 1;
+    private static final int VERSION_SOAP12 = 2;
+
     public static void processHTTPPostRequest(MessageContext msgContext, InputStream in,
                                               OutputStream out, String contentType, String
soapActionHeader, String requestURI)
             throws AxisFault {
-        boolean soap11 = false;
+
+        int soapVersion = VERSION_UNKNOWN;
 
         try {
 
@@ -173,7 +178,7 @@
             }
 
             // remove the starting and trailing " from the SOAP Action
-            if ((soapActionHeader != null) && soapActionHeader.startsWith("\"")
+            if ((soapActionHeader != null) && soapActionHeader.charAt(0) == '\"'
                 && soapActionHeader.endsWith("\"")) {
                 soapActionHeader = soapActionHeader.substring(1, soapActionHeader.length()
- 1);
             }
@@ -188,7 +193,13 @@
             StAXBuilder builder = null;
 
             if (contentType != null) {
-                if (contentType.toLowerCase().indexOf(HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED)
> -1) {
+
+                if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
+                    soapVersion = VERSION_SOAP12;
+                } else if (contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) >
-1) {
+                    soapVersion = VERSION_SOAP11;
+                }
+                if (soapVersion == VERSION_UNKNOWN && contentType.toLowerCase().indexOf(HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED)
> -1) {
                     // It is MIME (MTOM or SwA)
                     builder = TransportUtils.selectBuilderForMIME(msgContext, in, contentType,true);
                     envelope = (SOAPEnvelope) builder.getDocumentElement();
@@ -217,9 +228,7 @@
                         msgContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING,
charSetEnc);
                     }
 
-                    if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1)
{
-                        soap11 = false;
-
+                    if (soapVersion == VERSION_SOAP12) {
                         //Check for action header and set it in as soapAction in MessageContext
                         int index = contentType.indexOf("action");
                         if (index > -1) {
@@ -246,9 +255,7 @@
                                 new StAXSOAPModelBuilder(xmlreader,
                                                          SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
                         envelope = (SOAPEnvelope) builder.getDocumentElement();
-                    } else if (contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE)
> -1) {
-                        soap11 = true;
-
+                    } else if (soapVersion == VERSION_SOAP11) {
                         /**
                          * Configuration via Deployment
                          */
@@ -331,7 +338,7 @@
         } catch (FactoryConfigurationError e) {
             throw new AxisFault(e);
         } finally {
-            if ((msgContext.getEnvelope() == null) && !soap11) {
+            if ((msgContext.getEnvelope() == null) && soapVersion != VERSION_SOAP11)
{
                 msgContext.setEnvelope(new SOAP12Factory().getDefaultEnvelope());
             }
         }



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