• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web Services returning File help

 
Hitesh Gupta
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I had hosted simpla java file as web services using AXIS and TomCat.
This web services recieves the client request and creates pdf/rtf file out it and saves it on server machine.

I am able to successfully make a call to web servies from client machine and it is creating file on server machine.

Further My requirements is that after the file being created, it should be returned to client machine. Please let me know how I can achieve this functionality in WebServices.

Regards,
Hitesh.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Hithesh,
Apache AXIS has support for "SOAP Attachment".
Please check "handling attachment in apache axis"
If you can look at apache axis samples directory, you can also find some workout examples for the same.
Regards
Balaji
 
Hitesh Gupta
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi BalaJi,

Thanks for the reply.

Actually the google results tell how to send file to server from client.

But i had file being created on server and need it to be send back to client. I am calling Web Service by simply calling its invoke method.
What return parameters I expect for same?

Please help..!!!

Regards,
Hitesh
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Hithesh,
Please check the sample at http://svn.apache.org/viewvc/webservices/axis/trunk/java/samples/attachments/ It shows sending a file as an attachment then receives it as a return. The returned file is also compared to the source.
Regards
Balaji
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Attachments in JAX-RPC (and Axis 1.x) are handled through javax.activation.DataHandler from the JavaBeans Activation Framework and based on the media-type as supported by the JavaMail. So you will have to install both
JavaBeans Activation Framework (JAF)
JavaMail API
and verify the installation with http://localhost:8080/axis/happyaxis.jsp before attempting the example.

For some background see: SOAP attachments with JAX-RPC
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic