Author: richard.opalka(a)jboss.com
Date: 2008-07-30 08:28:08 -0400 (Wed, 30 Jul 2008)
New Revision: 7949
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
Log:
[JBWS-2190] apply user patch
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2008-07-30
10:31:20 UTC (rev 7948)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2008-07-30
12:28:08 UTC (rev 7949)
@@ -81,7 +81,9 @@
Element domEnv = null;
try
{
- domEnv = DOMUtils.parse(ins);
+ InputSource inputSource = new InputSource( ins );
+ inputSource.setEncoding( prepareEncoding( soapMessage ) );
+ domEnv = DOMUtils.parse( inputSource );
}
catch (IOException ex)
{
@@ -102,7 +104,9 @@
Element domEnv = null;
try
{
- domEnv = DOMUtils.parse(new InputSource(reader));
+ InputSource inputSource = new InputSource( reader );
+ inputSource.setEncoding( prepareEncoding( soapMessage ) );
+ domEnv = DOMUtils.parse( inputSource );
}
catch (IOException ex)
{
@@ -117,6 +121,16 @@
return build(soapMessage, domEnv);
}
+ private String prepareEncoding(SOAPMessage soapMessage) throws SOAPException
+ {
+ String encoding =
(String)soapMessage.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
+ if(encoding == null)
+ {
+ encoding = "UTF-8";
+ }
+ return encoding;
+ }
+
public SOAPEnvelope build(SOAPMessage soapMessage, Element domEnv) throws
SOAPException
{
// Construct the envelope
Show replies by date