-
Jun 13th, 2012, 09:05 AM
#1
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
-
Jun 14th, 2012, 01:49 AM
#2
-
Jun 14th, 2012, 05:19 AM
#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.
-
Jun 14th, 2012, 06:25 AM
#4
now I understand
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules