Posted: Fri Aug 28, 2009 9:49 am Post subject: sending HTTP Reply having pdf as payload
Disciple
Joined: 30 Sep 2004 Posts: 156
Hi All,
I am working on Http service in message broker which will receives a request from the browser.
Based on the request type , It need to retrieve the document from the file system and send the response as pdf to the caller(Need to be displayed as pdf in browser).
For this Req I have created a flow with HTTPinputNode-->compute Node-->HttpReply Node.
please give some suggestions on the below.
Is it possible to implement the above using message broker?
If yes what are all the HTTP Reply headers that i need to set?
What is the format of the http Payload?
I tried with the below code but it did't work
SET OutputRoot.HTTPReplyHeader."Content-Type"='application/pdf';
SET OutputRoot.BLOB.BLOB=CAST(SomeString as BLOB);
Posted: Fri Aug 28, 2009 9:59 am Post subject: Re: sending HTTP Reply having pdf as payload
Grand Master
Joined: 25 Jun 2008 Posts: 17447
kishoreraju wrote:
Hi All,
I am working on Http service in message broker which will receives a request from the browser.
Based on the request type , It need to retrieve the document from the file system and send the response as pdf to the caller(Need to be displayed as pdf in browser).
For this Req I have created a flow with HTTPinputNode-->compute Node-->HttpReply Node.
How do you think you will read from the File system in a Compute node?
Posted: Fri Aug 28, 2009 10:40 pm Post subject: Re: sending HTTP Reply having pdf as payload
Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
kishoreraju wrote:
If yes what are all the HTTP Reply headers that i need to set?
What is the format of the http Payload?
I tried with the below code but it did't work
SET OutputRoot.HTTPReplyHeader."Content-Type"='application/pdf';
SET OutputRoot.BLOB.BLOB=CAST(SomeString as BLOB);
Thanks in Advance..
I see two main issues that you face.
1) Getting the HTTPReply message formatted correctly
2) Getting the PDF properly cast to a BLOB
The first can be acheived by importing the relevant sample flow into your Toolkit, deploying it after inserting TraceNodes at the relevant parts of the flow and examining the usertrace output.
The second is a pretty common issue. There are many posts in this forum where casting something to a BLOB is discussed. Take a look at them and see what you learn.
Try these and then by all means come back to us with more questions. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum