Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-393

Incoming message with with UTF-8 BOM is failing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.5.4
    • Component/s: XML
    • Labels:
      None
    • Environment:
      Reproduced on Windows & Solaris/AMD

      Description

      When submitting a SOAP request that contains a UTF BOM http://unicode.org/faq/utf_bom.html#22, the following fault string is returned: "Could not access envelope: Unable to create envelope from given source:"

      After removing the offending BOM, and not manipulating the XML in any other way, the message is is delivered to the defined Endpoint successfully.

      Per http://unicode.org/faq/utf_bom.html#29 , Spring-WS should be able to transparently ignore the BOM on UTF-8 files.

      1. STARExportSigned_no_BOM.xml
        4 kB
        Nayan Hajratwala
      2. STARExportSigned_with_BOM.xml
        4 kB
        Nayan Hajratwala

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Could you please give some more information: are you using SAAJ or Axiom?
        Could you please supply the stacktrace (as attachment)?

        Show
        arjen.poutsma Arjen Poutsma added a comment - Could you please give some more information: are you using SAAJ or Axiom? Could you please supply the stacktrace (as attachment)?
        Hide
        nhajratw Nayan Hajratwala added a comment -

        I'm using SAAJ – I will attach a stacktrace & sample file later today, once i reach the office.

        Show
        nhajratw Nayan Hajratwala added a comment - I'm using SAAJ – I will attach a stacktrace & sample file later today, once i reach the office.
        Hide
        nhajratw Nayan Hajratwala added a comment -

        Here is the error message in the log:

        Jul 11, 2008 9:22:01 AM com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
        SEVERE: SAAJ0511: Unable to create envelope from given source

        So, perhaps it is a problem in SAAJ? I'm using the SAAJ that is distributed with jwsdp1.3, and can't upgrade since we are on JDK 1.4 ..

        If it is a problem with this SAAJ, maybe Spring-WS can strip off the BOM.

        I've attached a file with and without a BOM as examples.

        Show
        nhajratw Nayan Hajratwala added a comment - Here is the error message in the log: Jul 11, 2008 9:22:01 AM com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope SEVERE: SAAJ0511: Unable to create envelope from given source So, perhaps it is a problem in SAAJ? I'm using the SAAJ that is distributed with jwsdp1.3, and can't upgrade since we are on JDK 1.4 .. If it is a problem with this SAAJ, maybe Spring-WS can strip off the BOM. I've attached a file with and without a BOM as examples.
        Hide
        nhajratw Nayan Hajratwala added a comment -

        Here is the SOAP Fault that is returned:

        <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring xml:lang="en">Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

        Show
        nhajratw Nayan Hajratwala added a comment - Here is the SOAP Fault that is returned: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring xml:lang="en">Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
        Hide
        nhajratw Nayan Hajratwala added a comment -

        This is a UTF-8 SOAP message with a BOM

        Show
        nhajratw Nayan Hajratwala added a comment - This is a UTF-8 SOAP message with a BOM
        Hide
        nhajratw Nayan Hajratwala added a comment -

        This is a UTF-8 SOAP Message with no BOM

        Show
        nhajratw Nayan Hajratwala added a comment - This is a UTF-8 SOAP Message with no BOM
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Ok, thanks for the additional info. I will take a look at this for 1.5.4.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Ok, thanks for the additional info. I will take a look at this for 1.5.4.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I can reproduce this locally, using SAAJ 1.3. So whatever it is, they haven't solved it yet. I will ask the SAAJ mailing list about this, and probably write some workaround for Spring-WS.

        Note that as a workaround, you can use Axiom rather than SAAJ. Axiom works fine with UTF-8 BOMs.

        Show
        arjen.poutsma Arjen Poutsma added a comment - I can reproduce this locally, using SAAJ 1.3. So whatever it is, they haven't solved it yet. I will ask the SAAJ mailing list about this, and probably write some workaround for Spring-WS. Note that as a workaround, you can use Axiom rather than SAAJ. Axiom works fine with UTF-8 BOMs.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Fixed in SVN.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Fixed in SVN.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        This is a known bug in SAAJ, see https://saaj.dev.java.net/servlets/ReadMsg?list=users&msgNo=89. SPring-WS now has a workaround for this.

        Show
        arjen.poutsma Arjen Poutsma added a comment - This is a known bug in SAAJ, see https://saaj.dev.java.net/servlets/ReadMsg?list=users&msgNo=89 . SPring-WS now has a workaround for this.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            nhajratw Nayan Hajratwala
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: