Author |
Message
|
saddankula |
Posted: Fri Nov 15, 2013 9:21 am Post subject: HTTP Response Headers |
|
|
Acolyte
Joined: 27 Jun 2013 Posts: 51
|
how to set HTTP Response Headers to http request node dynamically in message broker |
|
Back to top |
|
 |
NealM |
Posted: Fri Nov 15, 2013 9:50 am Post subject: |
|
|
 Master
Joined: 22 Feb 2011 Posts: 230 Location: NC or Utah (depends)
|
Use the SOAPEnvelope node in front of it.
Update: Oops! (see next post)
Last edited by NealM on Fri Nov 15, 2013 6:42 pm; edited 1 time in total |
|
Back to top |
|
 |
mgk |
Posted: Fri Nov 15, 2013 12:45 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
Use the SOAPEnvelope node in front of it. |
Please don't use that - it will not add HTTP Headers.
Do you mean you want to add http request headers before an HTTPRequest node or response headers before an HTTPReply node? To add HTTPResponse headers, simple create an HTTPResponseHeader parser before the HTTPReply node and populate it with any headers you need. For the request case create an HTTPRequestHeader in a similar way before the HTTPRequest node. E.G:
Code: |
SET OutputRoot.HTTPRequestHeader.MyHeader = 42; |
The docs do have examples of this
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
saddankula |
Posted: Mon Nov 18, 2013 2:16 am Post subject: |
|
|
Acolyte
Joined: 27 Jun 2013 Posts: 51
|
I Add the 'HTTPResponseHeader' parser in front of HTTP reply node.
CREATE NEXTSIBLING of OutputRoot.Properties DOMAIN 'HTTPResponseHeader' NAME 'HTTPResponseHeader';
set OutputRoot.HTTPResponseHeader."X-Original-HTTP-Status-Line"='HTTP/1.1 500 OK';
but when HTTP reply node sends the response to HTTP request node the default value will be set to X-Original-HTTP-Status-Line"='HTTP/1.1 200 OK';
but i want to set X-Original-HTTP-Status-Line"='HTTP/1.1 500 OK';
How can i change. |
|
Back to top |
|
 |
mgk |
Posted: Mon Nov 18, 2013 3:05 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Do you really need to send a "500 OK" reply?
The best way to set the status code is to set it in the LE:
Code: |
SET OutputLocatEnvironment.Destination.HTTP.ReplyStatusCode = 500; |
and make sure your "compute mode" on the node includes "Environment".
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|