Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 46499 invoked from network); 28 Sep 2010 21:08:47 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Sep 2010 21:08:47 -0000 Received: (qmail 6561 invoked by uid 500); 28 Sep 2010 21:08:47 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 6461 invoked by uid 500); 28 Sep 2010 21:08:46 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 6452 invoked by uid 99); 28 Sep 2010 21:08:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Sep 2010 21:08:46 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of alwoude@hotmail.com designates 65.55.116.107 as permitted sender) Received: from [65.55.116.107] (HELO blu0-omc3-s32.blu0.hotmail.com) (65.55.116.107) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Sep 2010 21:08:36 +0000 Received: from BLU149-W23 ([65.55.116.72]) by blu0-omc3-s32.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 28 Sep 2010 14:08:15 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_fbd7dd75-4cb2-41ac-bfca-3fab80f9bfa7_" X-Originating-IP: [77.251.161.213] From: Alexander Woude To: Subject: RE: MTOM Service, cannot get incoming file from http request? Date: Tue, 28 Sep 2010 21:08:15 +0000 Importance: Normal In-Reply-To: <201009281446.37190.dkulp@apache.org> References: ,<201009281446.37190.dkulp@apache.org> MIME-Version: 1.0 X-OriginalArrivalTime: 28 Sep 2010 21:08:15.0736 (UTC) FILETIME=[448E5780:01CB5F51] X-Virus-Checked: Checked by ClamAV on apache.org --_fbd7dd75-4cb2-41ac-bfca-3fab80f9bfa7_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I will do that in the morning when I am at the office again. Have to create a client. At the moment I used soapUI. There is something funny though=2C when I set my XmlMimeType to "image/jpeg= "=2C the wsdl generated shows "*/*" to me that seems incorrect. Greetings=2C Alex > From: dkulp@apache.org > To: users@cxf.apache.org > Subject: Re: MTOM Service=2C cannot get incoming file from http request? > Date: Tue=2C 28 Sep 2010 14:46:36 -0400 > CC: alwoude@hotmail.com >=20 >=20 > Honestly=2C that all looks correct. Any chance you can package up a test= case=2C=20 > including what is happening on the client side? >=20 > Dan >=20 >=20 > On Tuesday 28 September 2010 5:28:15 am Alexander Woude wrote: > > Hi guys=2C > >=20 > > I try to sent a file (jpg or pdf) to my Webservice using MTOM. > > When I try to write the file to disk=2C the file is only 1 k big and co= ntains > > different data then I expect. I test the service with attachment throug= h > > SOAP. > >=20 > > What do I do wrong? > >=20 > > Service Implementation: > >=20 > > @WebService(endpointInterface =3D "zz.com.HelloWorld") > > public class HelloWorldImpl implements HelloWorld { > >=20 > > public int uploadData( > > @XmlMimeType("*/*") DataHandler code) { > > try { > > OutputStream fos =3D new FileOutputStream(new > > File("c:\\MTOM.jpg"))=3B > >=20 > > InputStream fis =3D code.getInputStream()=3B > >=20 > > byte[] b =3D new byte[1000000]=3B > > int bytesRead =3D 0=3B > > while ((bytesRead =3D fis.read(b)) !=3D -1) { > > fos.write(b=2C 0=2C bytesRead)=3B > > } > > fos.flush()=3B > > fos.close()=3B > > fis.close()=3B > >=20 > > } catch (IOException e) { > > // TODO Auto-generated catch block > > e.printStackTrace()=3B > > } > > return 0=3B > > } > > } > >=20 > > BEANS.XML > >=20 > > > address=3D"/HelloWorld"> > >=20 > > > > > > > > > >=20 > > >=20 > --=20 > Daniel Kulp > dkulp@apache.org > http://dankulp.com/blog = --_fbd7dd75-4cb2-41ac-bfca-3fab80f9bfa7_--