This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes Web Services returning File help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web Services returning File help" Watch "Web Services returning File help" New topic
Author

Web Services returning File help

Hitesh Gupta
Greenhorn

Joined: Jul 03, 2008
Posts: 15
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

Joined: Jul 13, 2001
Posts: 3150
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


Spritle Software Blogs
Hitesh Gupta
Greenhorn

Joined: Jul 03, 2008
Posts: 15
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

Joined: Jul 13, 2001
Posts: 3150
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

Joined: Aug 19, 2005
Posts: 2921
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web Services returning File help
 
Similar Threads
steps to run an applet
run .bat file from client machine of deployed web application on server machine
serial communication using applet
File Permission error while calling java Stored Procedure
instaling application on client side