Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 53268 invoked by uid 500); 3 Apr 2002 15:31:27 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 53256 invoked from network); 3 Apr 2002 15:31:26 -0000 Message-ID: From: "Blumenkrantz, Jason" To: "Axis-Dev (E-mail)" Subject: Bug in attachment handling / MimeUtils Date: Wed, 3 Apr 2002 10:31:26 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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? Thanks, Jason Blumenkrantz jason.blumenkrantz@tfn.com