ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » HTTPInputHeaders

Post new topic  Reply to topic
 HTTPInputHeaders « View previous topic :: View next topic » 
Author Message
goffinf
PostPosted: Sat Mar 19, 2011 8:54 am    Post subject: HTTPInputHeaders Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

version: 6.1.0.3 (Windows / AIX)

I am sending a HTTP request to my flow, and this request contains a custom HTTP header. Here is what it looks like in TCPMon :-

POST /RetrieveMotorPolicy HTTP/1.1
Content-Length: 494
SOAPAction: urn:RetrieveMotorPolicy
Content-Type: text/xml; charset=utf-8
testMethodName: callAdaptorEndpoint
Host: 127.0.0.1:7081
Connection: keep-alive

However, when I attempt to extract that value in a Compute node following the HTTPInput using this code it fails (that is, it returns 'unknown' from COALESCE) :-

Code:

DECLARE testMethodName CHAR TRIM(COALESCE(InputRoot.HTTPInputHeader."testMethodName", 'unknown'));


If I look at the input message tree in debug, I can see that the header is present BUT, the name is now 'Testmethodname'.

Code:

HTTPInputHeader
   X-Original-HTTP-Command:CHARACTER:POST http://127.0.0.1:7081/RetrieveMotorPolicy HTTP/1.1
   Content-Length:CHARACTER:494
   SOAPAction:CHARACTER:urn:RetrieveMotorPolicy
   Content-Type:CHARACTER:text/xml; charset=utf-8

   Testmethodname:CHARACTER:callAdaptorEndpoint

   Host:CHARACTER:127.0.0.1:7081
   Connection:CHARACTER:keep-alive
   X-Remote-Addr:CHARACTER:127.0.0.1
   X-Remote-Host:CHARACTER:127.0.0.1
   X-Server-Name:CHARACTER:127.0.0.1
   X-Server-Port:CHARACTER:7081
   X-Scheme:CHARACTER:http


Why is that ?

Obviously I can change my logic to use this changed name but is the behaviour that is expected, seems mighty odd ?

Thanks

Fraser.[/code]
Back to top
View user's profile Send private message
mgk
PostPosted: Sat Mar 19, 2011 1:11 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
Obviously I can change my logic to use this changed name but is the behaviour that is expected


Unfortunately, yes, this is expected behaviour for internal reasons and there are no plans to change it so you should be able to rely on using the capitalised name...


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
View user's profile Send private message
rekarm01
PostPosted: Sat Mar 19, 2011 9:37 pm    Post subject: Re: HTTPInputHeaders Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

FWIW, the HTTP standard specifies that HTTP header field names are case-insensitive.

It's surprising that the WMB HTTP header parsers don't preserve the case of field names, but good to know.
Back to top
View user's profile Send private message
goffinf
PostPosted: Sun Mar 20, 2011 5:50 am    Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

Quote:
FWIW, the HTTP standard specifies that HTTP header field names are case-insensitive.


Indeed, but unfortunately NOT in Broker
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sun Mar 20, 2011 6:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

goffinf wrote:
Quote:
FWIW, the HTTP standard specifies that HTTP header field names are case-insensitive.


Indeed, but unfortunately NOT in Broker


Well, ESQL *is* case-sensitive, so there is a difference in ESQL between testMethodName and Testmethodname.

And Broker is technically treating the HTTP headers themselves as case-insensitive values. It is just not acting in a case-preserving manner - it is transforming the headers into Titlecase, regardless of whether they came in in camelCase or not.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sun Mar 20, 2011 7:38 am    Post subject: Re: HTTPInputHeaders Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

goffinf wrote:
Indeed, but unfortunately NOT in Broker

"Case-insensitive" means that the broker should recognize header field names, regardless of case, when parsing an HTTP message. For example, it should recognize that 'CONTENT-TYPE', 'content-type', and 'CoNtEnT-tYpE' all refer to the 'Content-Type' entity header. It also means that the broker can expect downstream components to do the same, so it's free to change the case as needed, (to some common form), when writing an HTTP message.

It does not mean that the ESQL field references should also be case-insensitive.

goffinf wrote:
Code:
testMethodName: callAdaptorEndpoint

User-defined header field names should begin with 'X-'; for example: 'X-Testmethodname'.


The correct spelling of 'adapter' (or 'capitalized') is a different matter ...
Back to top
View user's profile Send private message
mgk
PostPosted: Sun Mar 20, 2011 10:04 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
"Case-insensitive" means that the broker should recognize header field names, regardless of case, when parsing an HTTP message. For example, it should recognize that 'CONTENT-TYPE', 'content-type', and 'CoNtEnT-tYpE' all refer to the 'Content-Type' entity header


I believe it does do this on input to the flow. The only time the capitalization behaviour is normally noticed is with userdefined headers...

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » HTTPInputHeaders
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.