axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r433213 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
Date Mon, 21 Aug 2006 10:05:07 GMT
Author: chinthaka
Date: Mon Aug 21 03:05:06 2006
New Revision: 433213

URL: http://svn.apache.org/viewvc?rev=433213&view=rev
Log:
Fixing the incorrect logic I've put to differentiate between SOAP and REST. I forgot the content
type of SOAP 1.1 is text/xml and put that as a REST request. Fixed it.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.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?rev=433213&r1=433212&r2=433213&view=diff
==============================================================================
--- 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
Mon Aug 21 03:05:06 2006
@@ -169,9 +169,7 @@
         MessageContext msgContext;
         OutputStream out = res.getOutputStream();
 
-        String contentType = req.getContentType();
-
-        if (!disableREST && enableRESTInAxis2MainServlet && isRESTContentType(contentType))
{
+        if (!disableREST && enableRESTInAxis2MainServlet && isRESTRequest(req))
{
             msgContext = createMessageContext(req, res);
             try {
                 new RESTUtil(configContext).processPostRequest(msgContext,
@@ -452,11 +450,13 @@
      * - application/x-www-form-urlencoded
      * as REST content types in this servlet.
      *
-     * @param contentType
+     * @param request
      */
-    private boolean isRESTContentType(String contentType) {
-        return (contentType.indexOf(HTTPConstants.MEDIA_TYPE_TEXT_XML) > -1) ||
-                (contentType.indexOf(HTTPConstants.MEDIA_TYPE_X_WWW_FORM) > -1);
+    private boolean isRESTRequest(HttpServletRequest request) {
+        String contentType = request.getContentType();
+        String soapActionHeader = request.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
 
+        return ((soapActionHeader == null) ||
+                (contentType != null && contentType.indexOf(HTTPConstants.MEDIA_TYPE_X_WWW_FORM)
> -1) );
     }
 }



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