I am using AXIS2 1.3.  I have a client that runs on Z/OS.  When I make a web 
service call using WS-Security, I get a WSSecurityException: Unsupported 
encoding (EBCDIC).  I have debugged this problem and found the following.

In Axis2Util.getSOAPEnvelopeFromDOMDocument,

XMLUtils.outputDOM(doc.getDocumentElement(), os, true);

appears to prepend the encoding declaration to the document and encode that 
declaration itself in EBCDIC.  The rest of the document is encoded in UTF-8.

Then

ByteArrayInputStream bais =  new ByteArrayInputStream(os.toByteArray());
StAXSOAPModelBuilder stAXSOAPModelBuilder = new 
StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(bais), 
null);

StAXSOAPModelBuilder throws the WSSecurityException because of the EBCDIC.

According to the W3C XML spec:

"In the absence of information provided by an external transport protocol (e.g. 
HTTP or MIME), it is a fatal error<http://www.w3.org/TR/2006/REC-xml-20060816/> 
for an entity including an encoding declaration to be presented to the XML 
processor in an encoding other than that named in the declaration, or for an 
entity which begins with neither a Byte Order Mark nor an encoding declaration 
to use an encoding other than UTF-8."

I am not using HTTP or MIME, etc.  Therefore, the encoding declaration should 
not be in EBCDIC at all.

I see no way around this problem unless there is some option or setting to 
prevent the behavior.  Has anyone seen this before and have a solution?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to