|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
HTTPResponseHeader |
« View previous topic :: View next topic » |
Author |
Message
|
mangoMan |
Posted: Tue Sep 28, 2004 11:22 am Post subject: HTTPResponseHeader |
|
|
Acolyte
Joined: 16 Oct 2003 Posts: 69
|
I have to respond to the calling webservice with an HTTP status code of 500. So I create my own HTTPResponseHeader
Quote: |
SET OutputRoot.HTTPResponseHeader."X-Original-HTTP-Status-Line" = 'HTTP/1.1 500 Internal Server Error';
SET OutputRoot.HTTPResponseHeader."X-Original-HTTP-Status-Code" = '500';
SET OutputRoot.HTTPResponseHeader."Content-Type" = 'text/html';
|
but when I trace the msg on the other side the header looks like this:
Quote: |
(0x01000000):HTTPResponseHeader = (
(0x03000000):X-Original-HTTP-Status-Line = 'HTTP/1.1 200 OK'
(0x03000000):X-Original-HTTP-Status-Code = 200
(0x03000000):Content-Type = 'text/xml; charset=utf-8'
(0x03000000):Content-Length = '761'
(0x03000000):Date = 'Tue, 28 Sep 2004 17:14:48 GMT'
(0x03000000):Server = 'Apache Coyote/1.0'
(0x03000000):Connection = 'close'
)
|
what is happening? I did remember to uncheck "Generate HTTP headers from input or response" but I also tried it with it checked but no luck  |
|
Back to top |
|
 |
mgk |
Posted: Tue Sep 28, 2004 1:49 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
As you have found, the default HTTP Status Code is 200 (meaning "OK").
To change this, you need to set the reply status code to the desired value in the LocalEnvironment in a Compute Node, e.g.
SET OutputLocalEnvironment.Destination.HTTP.ReplyStatusCode = '500';
This allows the HTTPReply node to report an error (or any other valid HTTP Status-Code) back to the requesting client.
Cheers, _________________ 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 |
|
 |
mangoMan |
Posted: Wed Sep 29, 2004 3:38 pm Post subject: |
|
|
Acolyte
Joined: 16 Oct 2003 Posts: 69
|
Thank you! I am back in action. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|