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 » Setting extra headers for the HTTPRequest node

Post new topic  Reply to topic
 Setting extra headers for the HTTPRequest node « View previous topic :: View next topic » 
Author Message
gs
PostPosted: Fri Oct 02, 2015 2:45 am    Post subject: Setting extra headers for the HTTPRequest node Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

The flow is to send XML data to a web service using the HTTPRequest node.
The request should include an extra HTTP header which I'm having trouble setting.

Preferably this would have been set in the localenv overrides for the node but it seems the only location to put this is in the HTTPRequestHeader.

Code:
SET OutputRoot.HTTPRequestHeader.MyHeader = 'MyValue';


The HTTPRequest node is set to "Generate default HTTP headers from input" since I don't want to set the host in my flow (the URL is configured per environment in a bar file override).
The added header gets sent just fine together with the auto-generated ones BUT the body is removed and Content-Length set to 0.
When removing the above code snippet, the body gets sent just fine together with a valid Content-Length.

Am I approaching this the wrong way or is this unexpected behaviour in WMB?

WMB version 8.0.0.5 on Windows
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Oct 02, 2015 5:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Are you setting the HTTP-Request header after you've already set the body?

Remember that ESQL populates the tree in the order you create it.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
gs
PostPosted: Fri Oct 02, 2015 6:18 am    Post subject: Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

mqjeff wrote:
Are you setting the HTTP-Request header after you've already set the body?

Remember that ESQL populates the tree in the order you create it.


Yes, but it shouldn't matter since it's different parts of the message tree?
The HTTPRequestHeader is directly under the Root.

Also, the tree looks correct prior to the HTTPRequest node (debugger/trace).
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Oct 02, 2015 6:30 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If it is before the last child of root, then you should make sure the last child of root has a parser...
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
gs
PostPosted: Fri Oct 02, 2015 6:54 am    Post subject: Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

mqjeff wrote:
If it is before the last child of root, then you should make sure the last child of root has a parser...


Now I feel really silly (where's my facepalm emoticon?) The body wasn't the last child of root. Fixing that fixed my issue, thanks!
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 » Setting extra headers for the HTTPRequest node
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.