my dog learned polymorphism*
The moose likes Web Services and the fly likes passing special characters through url to a web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "passing special characters through url to a web service" Watch "passing special characters through url to a web service" New topic
Author

passing special characters through url to a web service

sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
I am trying to pass the following string in the url to a web service:



The string is passed into the web service but is truncated at the first # sign. The log says it is a EOF character. I need to pass in the whole string.
How can I accomplish that?


Thanks,

Sonia
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41601
    
  55
You could encode it using base-64 (using a library like Apache Commons Codec), or put it into a CDATA section (if you have that much control over the WS client).


Ping & DNS - my free Android networking tools app
Patel Chintan
Ranch Hand

Joined: Mar 01, 2007
Posts: 80
hi, you need to replace special characters with some other character string.

Check this URL:
http://datewithjava.blogspot.com/2009/09/special-characters-in-url.html

sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
Thanks for that. That seemed to have helped. Now it has an error at \" in the string posted previously.

Thanks,

Sonia
sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
Thanks a lot for that tip. I have been struggling with it since yesterday. I replaced \" with the hex equivalent and that fixed it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing special characters through url to a web service