cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Woude <alwo...@hotmail.com>
Subject RE: MTOM Service, cannot get incoming file from http request?
Date Tue, 28 Sep 2010 21:08:15 GMT

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: dkulp@apache.org
> To: users@cxf.apache.org
> Subject: Re: MTOM Service, cannot get incoming file from http request?
> Date: Tue, 28 Sep 2010 14:46:36 -0400
> CC: alwoude@hotmail.com
> 
> 
> 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
> dkulp@apache.org
> http://dankulp.com/blog
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message