[jboss-user] [JBoss Web Services] - JAX-WS how to read a different charset
Morten Nyhaug
do-not-reply at jboss.com
Mon Nov 26 07:34:54 EST 2012
Morten Nyhaug [https://community.jboss.org/people/morten.nyhaug] created the discussion
"JAX-WS how to read a different charset"
To view the discussion, visit: https://community.jboss.org/message/778327#778327
--------------------------------------------------------------
How can I set a JAX-WS webservice to accept content with charset="iso-8859-1" on a system that is using "utf-8"?
If this was just a servlet, I would have done something like this:
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String content = "";
BufferedReader reader = new BufferedReader(new InputStreamReader(
request.getInputStream(), "ISO-8859-1"));
try {
for (String line = reader.readLine(); line != null; line = reader.readLine()) {
content += line;
}
} finally {
reader.close();
}
}
But how can I accomplish the same using a web service?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/778327#778327]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121126/f3dc3158/attachment.html
More information about the jboss-user
mailing list