• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Return a file (pdf) through a web service

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 69
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic