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

Return a file (pdf) through a web service

 
Cory Max
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ganesh Kolhe
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 69
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic