Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing text file in webservice

 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Jake Farley
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic