JBoss Community

JAX-WS how to read a different charset

created by Morten Nyhaug in JBoss Web Services - View the full discussion

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

Start a new discussion in JBoss Web Services at Community