Author |
Message
|
gs |
Posted: Fri Oct 02, 2015 2:45 am Post subject: Setting extra headers for the HTTPRequest node |
|
|
 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 |
|
 |
mqjeff |
Posted: Fri Oct 02, 2015 5:47 am Post subject: |
|
|
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 |
|
 |
gs |
Posted: Fri Oct 02, 2015 6:18 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Fri Oct 02, 2015 6:30 am Post subject: |
|
|
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 |
|
 |
gs |
Posted: Fri Oct 02, 2015 6:54 am Post subject: |
|
|
 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 |
|
 |
|