axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ng, Charles" <>
Subject RE: Bug in attachment handling / MimeUtils
Date Wed, 03 Apr 2002 16:41:36 GMT
This makes the assumption that the servlet container will do HTTP chunking
for you.  I know Tomcat 3.2 does not.


-----Original Message-----
From: Blumenkrantz, Jason []
Sent: Wednesday, April 03, 2002 10:31 AM
To: Axis-Dev (E-mail)
Subject: Bug in attachment handling / MimeUtils

I'm having a problem returning Attachments via Axis using the
JAFDataHandlerSerializer and org.apache.axis.attachments.MimeUtils. The
DataHandler is being returned fine and added as an attachment, but the
content's mime part ends up empty. The problem seems to be in
MimeUtils.getContentLength(), where if the DataSouce is not a file
DataSource, the input stream is read in completely to determine the content
length. Since my service returns a live InputStream and not a File, the
stream is invalidated by the reading process.  So not only is the stream
read entirely into memory, but the attachment data is never being written
out to the client. The two possible solutions I see to this problem would be
to keep the in-memory buffer around and write that out instead of
incorrectly reusing the InputStream (which is suboptimal, since this
requires the entire stream to be read into memory), or in the case of MIME
attachments which are not file attachments, to not write back the content
length in the response at all. I've modified a copy of AxisServlet to never
write the content length in this case, and it seems to work fine with both
Axis and VS.NET clients. Anyone have ideas on the best way to fix the
current incorrect behavior?

Jason Blumenkrantz

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

View raw message