aspose file tools*
The moose likes Web Services and the fly likes Return a file (pdf) through a web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Return a file (pdf) through a web service" Watch "Return a file (pdf) through a web service" New topic
Author

Return a file (pdf) through a web service

Cory Max
Ranch Hand

Joined: Jul 20, 2005
Posts: 83
Hi Everyone,

I know this may seem like an odd request, but we would like our web service to return a pdf file... Is this possible? Could someone point me in the right direction?

Thanks again gurus.

Cheers,


Cory


There are only 10 types of people in this world... Those who understand binary and those who don't.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42277
    
  64
The more common case is to transfer files from the client to the server, which is described in articles here and here. But the same techniques may be applicable to the reverse case as well.


Ping & DNS - my free Android networking tools app
Ganesh Kolhe
Greenhorn

Joined: Jul 05, 2009
Posts: 2
We have done with passing PDF byte array as String in String[] as return type where in we can pass other parameter from Web service
Please be at the blog
http://google-ecm.blogspot.com/2009/06/how-to-retu...-pdf-file-byte-array-from.html
Lalit Bhatt
Ranch Hand

Joined: Dec 27, 2007
Posts: 69

check MTOM. There is support for same in JAX-WS. If you are in JAX-RPC than use SAAJ api's. It has capability to attach the attachments.


Java-JavaEE Hibernate Spring Software Development Business Process Analysis
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12805
    
    5
We have done with passing PDF byte array as String in String[] as return type


Now THAT is a disaster waiting to happen since byte to String always involves character conversions.

Perhaps you wanted to talk about base64 encoding of a byte[] to a String?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Return a file (pdf) through a web service