• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Web Services returning File help

 
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.
 
author and deputy
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
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
 
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
 
Your mind is under my control .... your will is now mine .... read this tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic