Question

  Asked: Jun 19 2008   8:05 AM GMT
  Asked by: Idiva


charset problem


REST, RESTful Web services, Jersey, JAX-RS, Web services, NetBeans, Ajax, JavaScript

I'm devloping RESTful web services using jersey in NetBeans 6.0. I'm accessing the services through Ajax javascript. In each request i'm sending an xmlString which is then parsed at the service level and stored in the database. This is working fine.

For the same service i'm trying to access from java through org.apache.commons.httpclient.
I'm successful in hitting the service and sending the xmlString to the service. But at the service level xmlString is corrupted. All the <, > and / symbols are transformed in to equivalent %3C, %3E etc.....


xmlString at the httpclient:
<Data><anlEventId>10</anlEventId><anlApplication>abc</anlApplication>/Data>

xmlString at the RESTService.
%3CData%3E%3CanlEventId%3E10%3C%2FanlEventId%3E%3CanlApplication%3Eabc%3C%2FanlApplication%3E%3C%2FData%3E

Server: Tomcat 6.0
Platform: Java
Services: RESTful Web services using jersey(NetBeans plugin for jersey)

at the client level i've checked the charset of the request and response(using post.getResponseCharSet() & post. getRequestCharSet()). In both cases it is iso-8859-1. Still it creating problem.

Please let me know is there any solution.

Thanks
Srini

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


Start this Answer and Earn your Knowledge Points!

By clicking "Create Answer", you can write the answer to this question that can be improved upon by your peers using the Answer Wiki.

Browse more Questions and Answers on Development.

Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register