Author: richard.opalka(a)jboss.com
Date: 2008-07-30 10:09:59 -0400 (Wed, 30 Jul 2008)
New Revision: 7953
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
Log:
[JBWS-2190] improving user patch, let DOM utils determinate default encoding
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
14:09:03 UTC (rev 7952)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2008-07-30
14:09:59 UTC (rev 7953)
@@ -81,9 +81,13 @@
Element domEnv = null;
try
{
- InputSource inputSource = new InputSource( ins );
- inputSource.setEncoding( prepareEncoding( soapMessage ) );
- domEnv = DOMUtils.parse( inputSource );
+ InputSource inputSource = new InputSource(ins);
+ String encoding = getEncoding(soapMessage);
+ if (encoding != null)
+ {
+ inputSource.setEncoding(encoding);
+ }
+ domEnv = DOMUtils.parse(inputSource);
}
catch (IOException ex)
{
@@ -105,8 +109,12 @@
try
{
InputSource inputSource = new InputSource( reader );
- inputSource.setEncoding( prepareEncoding( soapMessage ) );
- domEnv = DOMUtils.parse( inputSource );
+ String encoding = getEncoding(soapMessage);
+ if (encoding != null)
+ {
+ inputSource.setEncoding(encoding);
+ }
+ domEnv = DOMUtils.parse(inputSource);
}
catch (IOException ex)
{
@@ -121,14 +129,9 @@
return build(soapMessage, domEnv);
}
- private String prepareEncoding(SOAPMessage soapMessage) throws SOAPException
+ private String getEncoding(SOAPMessage soapMessage) throws SOAPException
{
- String encoding =
(String)soapMessage.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
- if(encoding == null)
- {
- encoding = "UTF-8";
- }
- return encoding;
+ return (String)soapMessage.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
}
public SOAPEnvelope build(SOAPMessage soapMessage, Element domEnv) throws
SOAPException
Show replies by date