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 up an HTTP POST in ESQL

Post new topic  Reply to topic
 Setting up an HTTP POST in ESQL « View previous topic :: View next topic » 
Author Message
petervh1
PostPosted: Mon Jun 26, 2017 7:51 am    Post subject: Setting up an HTTP POST in ESQL Reply with quote

Centurion

Joined: 19 Apr 2010
Posts: 122

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
View user's profile Send private message
Vitor
PostPosted: Tue Jun 27, 2017 5:39 am    Post subject: Re: Setting up an HTTP POST in ESQL Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

petervh1 wrote:

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.


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
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 up an HTTP POST in ESQL
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.