[ 
https://issues.apache.org/jira/browse/AXIS2-5489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13646348#comment-13646348
 ] 

Kishanthan Thangarajah commented on AXIS2-5489:
-----------------------------------------------

The change I propose is :

kernel/src/org/apache/axis2/description/WSDL2Constants.java

-    String LEGAL_CHARACTERS_IN_URL = "-._~!$&()*+,;=:@?/%";
-    String LEGAL_CHARACTERS_IN_PATH = "-._~!$'()*+,;=:@";
-    String LEGAL_CHARACTERS_IN_QUERY = "-._~!$'()*+,;=:@/?";
+    String LEGAL_CHARACTERS_IN_URL = "-._~!$&()*,;=:@?/%";
+    String LEGAL_CHARACTERS_IN_PATH = "-._~!$'()*,;=:@";
+    String LEGAL_CHARACTERS_IN_QUERY = "-._~!$'()*,;=:@/?";

I'm removing the "+" character from the list of legal characters allowed to be 
preserved in the URL. So when client sends a request containing this character, 
it will get encoded as %2B. And at server side, it will get decoded to the 
correct values. Attaching a patch for this change. You can try with this patch 
in your client side.
                
> Encoding GET parameters with '+' character in generated REST clients with 
> WSDL2Java
> -----------------------------------------------------------------------------------
>
>                 Key: AXIS2-5489
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5489
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel, transports
>    Affects Versions: 1.6.2
>         Environment: Ubuntu
>            Reporter: Miguel Ángel Francisco Fernández
>            Priority: Blocker
>              Labels: +, GET, REST, encode,
>             Fix For: 1.6.2
>
>         Attachments: AXIS2-5489.patch, axis2-kernel-1.6.2.jar
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Using the wsdl2java tool to generate a Java client to access a REST web 
> service described with a WSDL 2.0, the generated client does not encode the 
> symbol '+' in GET parameters.
> For example, if I have an URL "/get_url", and I set the parameter "param" to 
> "x+x", the symbol "+" is not encoded, and therefore it is interpreted as a 
> space on the server ("x x"). If I try to send the parameter encoded, i.e., 
> "%2B", then "%252B" is received in the server.
> Therefore, it is not possible to send the '+' symbol in a GET parameter.
> I guess that it is caused by the definition of the field 
> LEGAL_CHARACTERS_IN_QUERY in the interface 
> org.apache.axis2.description.WSDL2Constants, which is set to 
> "-._~!$'()*+,;=:@/?"

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to