Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-3437

Unsupported encoding error on Z/OS when using WS-Security

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.3
    • None
    • modules
    • None

    Description

      I am using AXIS2 1.3. I have a client that runs on Z/OS. When I make a web service call using Rampart for 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);

      prepends the encoding declaration to the document and encodes 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-encoded encoding declaration.

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bethayres Beth Ayres
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: