Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Problem with non utf-8 charset for a soap message with no xml declaration. #25

@glassfishrobot

Description

@glassfishrobot

When soap requests are encoded using ISO-8859-1 (the http content-type header
reflects that) and there is no xml declaration it results in the following error:

ERROR: 'Invalid byte 2 of 3-byte UTF-8 sequence.'

I am using the Spring WS framework, which actually picks up on the charset
encoding and sets the SOAPPartImpl sourceCharsetEncoding appropriately.

However, as Spring WS holds the transformation Source in a JAXMStreamSource it
gets converted to a SAX InputSource before being wrapped in a SAXSource. The
InputSource is not advised of the correct charset encoding, so it gets lost -
resulting in the exception being thrown.

The JavaDoc for InputSource states that setEncoding should be used when the
application is aware of the encoding. In this case it is.

So, I propose that in EnvelopeFactory.createEnvelope(), after the InputSource
gets created, a line is added where the encoding is set to the SOAPPartImpl
sourceCharsetEncoding

btw. at present this is a showstopper for me - does anyone hava a workaround?

Environment

Operating System: All
Platform: All

Affected Versions

[current]

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions