Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 81978 invoked from network); 10 Jun 2010 09:54:31 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Jun 2010 09:54:31 -0000 Received: (qmail 66805 invoked by uid 500); 10 Jun 2010 09:54:30 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 66050 invoked by uid 500); 10 Jun 2010 09:54:28 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 66030 invoked by uid 99); 10 Jun 2010 09:54:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jun 2010 09:54:27 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of naresh.tallapelli@gmail.com designates 209.85.212.41 as permitted sender) Received: from [209.85.212.41] (HELO mail-vw0-f41.google.com) (209.85.212.41) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jun 2010 09:54:19 +0000 Received: by vws8 with SMTP id 8so1816461vws.0 for ; Thu, 10 Jun 2010 02:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=GQNDp0nnSWFcY+oKwtO+lwli3iuF2m8LgHiLmCPHf0s=; b=khS3DoXJ+eB5seyUtLYu02N8Yb4TXNGxvjIxm/b35+25IeFvMjtsEPJ2kkCDHiUEVi 4gzX9UjkZw3tuvdU1wh4et84xgBAb1Sje0Hi6dXwLl/L97xi91vzC/YuHHvsjZ7oevZx t1vHG2HnzcmYWvX1fyOnfMBwWqZVZFsEDuoxY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=mLj3FnxQtmpIYG8UIxrzOGtFMd0RuThKYraDH0Nz1TPRD4kD0LRs2B2gQnWBXQhJg2 voi8CT8mMhjN+NzH6xgHX+F2J6jqbpeHzG43lAHcKzECH0MW4yw/kf9VzVrLUni2lCso LM5QUmeGEW3EKqvsE/aoR4WMf1yyquEnI7e0w= MIME-Version: 1.0 Received: by 10.224.27.215 with SMTP id j23mr3726161qac.224.1276163638130; Thu, 10 Jun 2010 02:53:58 -0700 (PDT) Received: by 10.220.74.136 with HTTP; Thu, 10 Jun 2010 02:53:58 -0700 (PDT) Date: Thu, 10 Jun 2010 15:23:58 +0530 Message-ID: Subject: How to send attachment in response to a web service call From: Naresh Tallapelli To: dev@cxf.apache.org, users@cxf.apache.org Content-Type: multipart/alternative; boundary=00c09f9b09ff537a4d0488aa0063 X-Virus-Checked: Checked by ClamAV on apache.org --00c09f9b09ff537a4d0488aa0063 Content-Type: text/plain; charset=ISO-8859-1 HI All, I am using CXF-2.1.2 version. I have a requirement to send an attachment from web services server to the client as part of one web service call response. I have created the response element as following in wsdl file, * * When web service operation is called i am creating "FileDataHandler" for file and returning the handler as part of response. Server is able to send the attachment to the client. I can see the following log message on web services server side. * ------=_Part_0_8371737.1276162616240 Content-Type: text/plain Content-Transfer-Encoding: binary Content-ID: This is the response created intially on the server.* But the client is not able to receive the attachment. In "AttachmentInInterceptor" if the message type is multipart, then we cxf code is loading the attachments lazily. That's the reason why the client is not able to get the response. Web services client is throwing the following exception, * java.io.EOFException: Unexpected end of ZLIB input stream at org.apache.cxf.attachment.AttachmentDeserializer.readNext(AttachmentDeserializer.java:187) at org.apache.cxf.attachment.LazyAttachmentCollection$1.hasNext(LazyAttachmentCollection.java:73) at org.apache.cxf.attachment.LazyDataSource.load(LazyDataSource.java:49) at org.apache.cxf.attachment.LazyDataSource.getContentType(LazyDataSource.java:59) at javax.activation.DataHandler.getContentType(Unknown Source) at javax.activation.DataHandler.getBaseType(Unknown Source) at javax.activation.DataHandler.getDataContentHandler(Unknown Source) at javax.activation.DataHandler.getContent(Unknown Source)* Please help me to resolve this issue.Any help would be much appreciated. Thank you, Naresh. --00c09f9b09ff537a4d0488aa0063--