*
The moose likes Web Services and the fly likes Passing text file in webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Passing text file in webservice" Watch "Passing text file in webservice" New topic
Author

Passing text file in webservice

Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
Hi,
I have to write a webservice which retrieves 20 mb text file from database and send it to client. What is the best way to do it?
Thanks in advance for your repies..


Rizwan
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
Jake Farley
Greenhorn

Joined: Nov 07, 2007
Posts: 2
You can Encode64 the text, is that what you are asking due to the fact that the text file could be XML? Assuming you are using JAX-WS type XML method invocation? There is an encode64(byte[] data) method, check your Java API reference on...

java.lang.Object
extended by net.landspurg.util.URLFetcher
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
What are your requirements on the client side?

Incorporating bulk text on the order of 20MB in a SOAP response would be incredibly wasteful and slow.

The SOAP with Attachments API for Java (SAAJ) is what you want. A google search for SAAJ will get you started.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing text file in webservice