Announcement Announcement Module
Collapse
No announcement yet.
Axiom based WS with attachments - encoding problems Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Axiom based WS with attachments - encoding problems

    Hello,

    I've switched from SaajSoapMessageFactory to AxiomSoapMessageFactory to handle large WS attachments more efficiently. I am using Spring WS 2.1 and Apache Axiom 1.2.13.

    This problem occurs with WS attachment which is an xml file (text/xml content type):
    - encoded in UTF-8 with BOM OR
    - has non ASCII characters i.e. ęąрш

    2012-06-13 13:13:40,378 ERROR [rt.service.episode.ws.AddMedCaseEndpoint] - Internal error org.apache.axiom.ext.io.StreamCopyException: Error reading from source
    org.apache.axiom.om.OMException: org.apache.axiom.ext.io.StreamCopyException: Error reading from source
    at org.apache.axiom.attachments.PartContentFactory.cr eatePartContent(PartContentFactory.java:153)
    at org.apache.axiom.attachments.PartImpl.fetch(PartIm pl.java:176)
    at org.apache.axiom.attachments.MIMEMessage.getNextPa rtDataHandler(MIMEMessage.java:299)
    at org.apache.axiom.attachments.MIMEMessage.fetchAllP arts(MIMEMessage.java:264)
    at org.apache.axiom.attachments.MIMEMessage.getConten tIDs(MIMEMessage.java:271)
    at org.apache.axiom.attachments.Attachments.getConten tIDSet(Attachments.java:311)
    at org.springframework.ws.soap.axiom.AxiomSoapMessage $AxiomAttachmentIterator.<init>(AxiomSoapMessage.j ava:360)
    (...)
    Caused by: java.io.IOException: Found LF without CR
    at org.apache.james.mime4j.codec.QuotedPrintableInput Stream.read0(QuotedPrintableInputStream.java:194)
    at org.apache.james.mime4j.codec.QuotedPrintableInput Stream.read(QuotedPrintableInputStream.java:306)
    at org.apache.axiom.attachments.utils.BAAOutputStream .readFrom(BAAOutputStream.java:112)

    The attachment uses CR LF as new line sign. With SaajSoapMessageFactory there is no problem with this attachment.

    Bart

  • #2
    I've reported it on Jira: https://jira.springsource.org/browse/SWS-780

    Comment


    • #3
      The request created with SoapUI was wrong. For UTF-8 XML attachment it adds a header Content-Type: text/xml; charset=Cp1250 and encodes the attachment with this charset.

      Comment


      • #4
        now I understand

        Comment

        Working...
        X