Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JAX-WS how to read a different charset

726437Nov 26 2012 — edited Nov 28 2012
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?
This post has been answered by jmsjr on Nov 28 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2012
Added on Nov 26 2012
11 comments
7,498 views