axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r641744 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/XFormURLEncodedBuilder.java
Date Thu, 27 Mar 2008 08:50:09 GMT
Author: keithc
Date: Thu Mar 27 01:50:08 2008
New Revision: 641744

URL: http://svn.apache.org/viewvc?rev=641744&view=rev
Log:
Fixing AXIS2-3405. As specified in http://www.w3.org/TR/xforms/#serialize-urlencode we should
be breaking the parameters b4 decoding

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/XFormURLEncodedBuilder.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/XFormURLEncodedBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/XFormURLEncodedBuilder.java?rev=641744&r1=641743&r2=641744&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/XFormURLEncodedBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/XFormURLEncodedBuilder.java
Thu Mar 27 01:50:08 2008
@@ -94,12 +94,7 @@
             throw new AxisFault("Cannot create DocumentElement without destination EPR");
         }
 
-        String requestURL = null;
-        try {
-            requestURL = URIEncoderDecoder.decode(endpointReference.getAddress());
-        } catch (UnsupportedEncodingException e) {
-            throw AxisFault.makeFault(e);
-        }
+        String requestURL = endpointReference.getAddress();
         try {
             requestURL = extractParametersUsingHttpLocation(templatedPath, parameterMap,
                                                             requestURL,
@@ -137,9 +132,16 @@
             for (int i = 0; i < parts.length; i++) {
                 int separator = parts[i].indexOf("=");
                 if (separator > 0) {
+                    String value = parts[i].substring(separator + 1);
+                    try {
+                        value = URIEncoderDecoder.decode(value);
+                    } catch (UnsupportedEncodingException e) {
+                        throw AxisFault.makeFault(e);
+                    }
+
                     parameterMap
                             .put(parts[i].substring(0, separator),
-                                 parts[i].substring(separator + 1));
+                                 value);
                 }
             }
 
@@ -314,7 +316,12 @@
 
     private void addParameterToMap(MultipleEntryHashMap parameterMap, String paramName,
                                    String paramValue)
-            throws UnsupportedEncodingException {
+            throws UnsupportedEncodingException, AxisFault {
+        try {
+            paramValue = URIEncoderDecoder.decode(paramValue);
+        } catch (UnsupportedEncodingException e) {
+            throw AxisFault.makeFault(e);
+        }
         if (paramName.startsWith(WSDL2Constants.TEMPLATE_ENCODE_ESCAPING_CHARACTER)) {
             parameterMap.put(paramName.substring(1), paramValue);
         } else {
@@ -335,5 +342,4 @@
             throw new AxisFault(Messages.getMessage("invalidSOAPversion"));
         }
     }
-}
-
+}
\ No newline at end of file



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