axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r559737 - /webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Date Thu, 26 Jul 2007 07:50:50 GMT
Author: keithc
Date: Thu Jul 26 00:50:49 2007
New Revision: 559737

URL: http://svn.apache.org/viewvc?view=rev&rev=559737
Log:
Fix for Axis2-3007. When isDoingREST is true check for the HTTP_METHOD property in the message
context and default accordingly. Can be overridden by specifying a 
specific messageType though. 


Modified:
    webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java

Modified: webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?view=diff&rev=559737&r1=559736&r2=559737
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
(original)
+++ webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Thu Jul 26 00:50:49 2007
@@ -41,6 +41,7 @@
 import org.apache.axis2.transport.http.ApplicationXMLFormatter;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.transport.http.SOAPMessageFormatter;
+import org.apache.axis2.transport.http.XFormURLEncodedFormatter;
 import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
@@ -278,7 +279,12 @@
 
             // If we are doing rest better default to Application/xml formatter
             if (msgContext.isDoingREST()) {
-                messageFormatter = new ApplicationXMLFormatter();
+                String httpMethod = (String) msgContext.getProperty(Constants.Configuration.HTTP_METHOD);
+                if (Constants.Configuration.HTTP_METHOD_GET.equals(httpMethod) ||
+                        Constants.Configuration.HTTP_METHOD_DELETE.equals(httpMethod)) {
+                    return new XFormURLEncodedFormatter();
+                }
+                return new ApplicationXMLFormatter();
             } else {
                 // Lets default to SOAP formatter
                 //TODO need to improve this to use the stateless nature



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