• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

how to open attachments

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im not sure exactly where this question belongs so I'll just post it here since it's related to the webservices I'm working on.

I have a service that when invoked returns the response with a pdf as an attachment. This is all initiated from a jsp page. A user clicks a button which then submits the form and then i have a scriptlet call a java class where the webservice is consumed. This returns the response and displays it in the jsp. Now, i also have a second button titled 'Display PDF' that when clicked I need to have display the pdf attachment in another window. How the heck do I go about that??
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assumption: The service-reply has the attachment as 'SOAP attachment'.

1. Without the need for the Display PDF button.
---> The service response that you get can be handled with *coding* Handlers in the client side, where you can process the returned pdf attachment and then display it directly in the browser.

2. With the Display PDF button.
---> You still code the client handler for handling the service-reply with attachment then store it locally. And when the Display pdf is clicked in the same session. Display the pdf (open the pdf) in the browser.

I hope this helps. Let the forum know, how you achieved this.
 
Michael Hul
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I should have posted earlier, but I did something like your 2nd suggestion. Since I invoked the webservice using the following I get the attachment (if it exists) using the following Then I convert the attachment to a byte array and store it in a static class variable in a separate class so that when the 'Display PDF' button is clicked, it loads a servlet that can access the attachment using a call similar to the following then I display it using That seems to work fine. Thanks for the reply
[ November 11, 2008: Message edited by: Michael Hul ]
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic