|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Setting up an HTTP POST in ESQL |
« View previous topic :: View next topic » |
Author |
Message
|
petervh1 |
Posted: Mon Jun 26, 2017 7:51 am Post subject: Setting up an HTTP POST in ESQL |
|
|
Centurion
Joined: 19 Apr 2010 Posts: 135
|
Hi all
IIB 10.0.0.6, Windows 8.1
I am trying to set up an HTTP POST to a server that expects a JSON string. I also need to pass 2 header parameters and 1 query string. I have read
http://www.mqseries.net/phpBB2/viewtopic.php?t=23737&highlight=outputroot+blob+blob+post
but am unable to get it working.
My code snippet is as follows:
Code: |
DECLARE POST2 CHAR '{"param1": "1234","param2": "User_Id_001"}';
SET OutputRoot.HTTPRequestHeader.POST = '/issue/rest/in?issueCode=true';
SET OutputRoot.HTTPRequestHeader."Content-Type" = 'application/json';
SET OutputRoot.HTTPRequestHeader."Content-Encoding" = 'identity';
SET OutputRoot.HTTPRequestHeader."apiId" = 'USER1';
SET OutputRoot.HTTPRequestHeader."apiPassword" = 'password';
SET OutputRoot.BLOB.BLOB = CAST(POST2 AS BLOB CCSID InputRoot.Properties.CodedCharSetId Encoding InputRoot.Properties.Encoding);
|
The query string is:
issueCode=true
and the header parms are:
apiId
apiPassword.
My HTTPRequest node has in the Advanced tab:
Use whole input message as request - checked
Replace input message with web-service response - checked
Generate default HTTP headers from input - checked
When I trigger the flow, I get a HTTP 200 response, so I am reaching the server, but I get back the default page for the server, and not the API path.
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 27, 2017 5:39 am Post subject: Re: Setting up an HTTP POST in ESQL |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I'm not surprised. The quoted thread is from 2005.
The product works differently now, including (but not limited to) native JSON support for message payloads.
Scrap this code, try again using the IIBv10 InfoCenter for reference. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
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
|
|
|
|