File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 12678
    
    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


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing text file in webservice
 
Similar Threads
Creating text fiel in server by JS or PHP
How can I see the output console?
how many ways do two java program communicate?
compress a xml file
Calling a .net web service from java as a client