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 IndexWebSphere Message Broker SupportMultiple web service request with a single HTTPRequest Node

Post new topicReply to topic
Multiple web service request with a single HTTPRequest Node View previous topic :: View next topic
Author Message
mkc
PostPosted: Thu Nov 23, 2017 7:33 am Post subject: Multiple web service request with a single HTTPRequest Node Reply with quote

Newbie

Joined: 23 Nov 2017
Posts: 2

Hi all,

Is there a way to maintain a single session with a HTTPRequest node wherein we can achieve the below scenario :
1) Hit the URL1 with http method as 'GET' which returns a token in response
2) Maintain the same session
3) Hit the URL2 with http method as 'PUT' with a message, passing the token from #1 in the http header.

Where URL1 and URL2 are having the same host and port, the URI changes.

I am seeing that the connection is closed after the response is received for GET and session is closed for #3 which returns a 403 error as the token is not valid for the new session.
Have tried "HTTP.KeepAlive = TRUE" option, but this does not work.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Nov 27, 2017 6:25 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24648
Location: Ohio, USA

Why do you need to maintain the same session? Why do you want to maintain the same session?

How would this work if you were using Java / Web not IIB?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mkc
PostPosted: Mon Nov 27, 2017 10:29 pm Post subject: resolved Reply with quote

Newbie

Joined: 23 Nov 2017
Posts: 2

This is resolved -
Solution
Add the cookie attribute in the request header:
CREATE LASTCHILD OF OutputRoot.HTTPRequestHeader NAME 'Cookie' VALUE InputRoot.HTTPResponseHeader."set-cookie";

where set-cookie would be the cookie value received from the response from the previous request.

Flow:
InputQueue -> 1st Compute node do GET --> 1st HTTP request Node --> 2nd Compute node do PUT --> 2nd HTTP request Node --> Output

requirement is to get a token from GET first and use the token to PUT in the same session.

In Java use CookieManager
CookieManager cookieManager = new CookieManager();
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportMultiple web service request with a single 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.