[jboss-user] [JBossWS] - Re: Charset encoding problem from Linux to Windows with Disp

cavani do-not-reply at jboss.com
Tue Apr 1 18:03:38 EDT 2008


It was just my stupidity that prevent me to success on this... sorry!

I updated xmlsec to last version 1.4.1 (from 1.3.0 that is distributed with JBossWS), but this didn't help.

After some reading about charset and encoding, The code that really works is this:


  |  Reader requestReader = new StringReader(requestMessage);
  |  StreamSource request = new StreamSource(requestReader);
  |  StreamSource response = dispatch.invoke(request);
  |  requestReader.close();
  |  TransformerFactory factory = TransformerFactory.newInstance();
  |  Transformer transformer = factory.newTransformer();
  |  BufferedStreamResult result = new BufferedStreamResult();
  |  transformer.transform(response, result);
  |  String responseMessage = result.toString();
  |  byte[] raw = responseMessage.getBytes("UTF-8");
  |  return new String(raw);
  | 

Thanks,

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140737#4140737

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140737



More information about the jboss-user mailing list