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, when I set my XmlMimeType to "image/jpeg", the wsdl generated shows "*/*" to me that seems incorrect. Greetings, Alex > From: [email protected] > To: [email protected] > Subject: Re: MTOM Service, cannot get incoming file from http request? > Date: Tue, 28 Sep 2010 14:46:36 -0400 > CC: [email protected] > > > Honestly, that all looks correct. Any chance you can package up a test case, > including what is happening on the client side? > > Dan > > > On Tuesday 28 September 2010 5:28:15 am Alexander Woude wrote: > > Hi guys, > > > > I try to sent a file (jpg or pdf) to my Webservice using MTOM. > > When I try to write the file to disk, the file is only 1 k big and contains > > different data then I expect. I test the service with attachment through > > SOAP. > > > > What do I do wrong? > > > > Service Implementation: > > > > @WebService(endpointInterface = "zz.com.HelloWorld") > > public class HelloWorldImpl implements HelloWorld { > > > > public int uploadData( > > @XmlMimeType("*/*") DataHandler code) { > > try { > > OutputStream fos = new FileOutputStream(new > > File("c:\\MTOM.jpg")); > > > > InputStream fis = code.getInputStream(); > > > > byte[] b = new byte[1000000]; > > int bytesRead = 0; > > while ((bytesRead = fis.read(b)) != -1) { > > fos.write(b, 0, bytesRead); > > } > > fos.flush(); > > fos.close(); > > fis.close(); > > > > } catch (IOException e) { > > // TODO Auto-generated catch block > > e.printStackTrace(); > > } > > return 0; > > } > > } > > > > BEANS.XML > > > > <jaxws:endpoint id="helloWorld" implementor="zz.com.HelloWorldImpl" > > address="/HelloWorld"> > > > > <jaxws:properties> > > <entry key="mtom-enabled" value="true" /> > > <entry key="mtom-threshold" value="0" /> > > </jaxws:properties> > > > > </jaxws:endpoint> > > -- > Daniel Kulp > [email protected] > http://dankulp.com/blog
