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 » QueryString is not accessible using HTTPRequest node in IIB9

Post new topic  Reply to topic
 QueryString is not accessible using HTTPRequest node in IIB9 « View previous topic :: View next topic » 
Author Message
tj
PostPosted: Fri Feb 19, 2016 12:53 pm    Post subject: QueryString is not accessible using HTTPRequest node in IIB9 Reply with quote

Newbie

Joined: 04 Aug 2014
Posts: 5

Hi,

I have been trying to invoke a RESTful web service using the HTTPRequest node in IIB9. It is a HTTP GET call and the URL contains a query string in it. I went through several resouces on the web to understand how to frame the below URL but I am not able to achieve it.

Quote:

-> Compute Mode is set to 'All'
-> Request parser set at HTTPInput node is XMLNSC
-> ResponseMessage parser for the HTTP Request node is set to JSON
-> Input Request XML:



Code:

<AWMRequest>
<DistributorID>122256</DistributorID>
<DistributorContext>DMU.DIST</DistributorContext>
</AWMRequest>



HTTP Input --> Compute --> HTTP Request --> HTTP Reply


http://abc.com/ods.svc/getAdvisorEligibility?dstrId=122256&dstrCtx=DMU.DIST?$format=JSON


Snippet - Option 1

Code:

SET OutputLocalEnvironment.HTTPRequestHeader."Content-Type" = 'application/x-www-form-urlencoded';
SET OutputLocalEnvironment.Destination.HTTP.RequestLine.Method = 'GET';
SET OutputLocalEnvironment.Destination.HTTP.QueryString.dstrId = InputRoot.XMLNSC.AWMRequest.DistributorID;
SET OutputLocalEnvironment.Destination.HTTP.QueryString.dstrCtx = InputRoot.XMLNSC.AWMRequest.DistributorContext;
SET OutputLocalEnvironment.Destination.HTTP.RequestURL ='http://abc.com/ods.svc/getPrimaryAdvisorEligibility';


Snippet - Option 2


Code:

SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://abc.com/ods.svc/getPrimaryAdvisorEligibility';
SET OutputLocalEnvironment.Destination.HTTP.QueryString.dstrId = InputRoot.XMLNSC.AWMRequest.DistributorID;
SET OutputLocalEnvironment.Destination.HTTP.QueryString.dstrCtx = InputRoot.XMLNSC.AWMRequest.DistributorContext;
SET OutputLocalEnvironment.Destination.HTTP.QueryStringCCSID = 943;
SET OutputLocalEnvironment.Destination.HTTP.RequestLine.Method = 'GET';
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Feb 19, 2016 1:55 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Did you check if the query string is valid and returns anything?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
tj
PostPosted: Fri Feb 19, 2016 2:32 pm    Post subject: Reply with quote

Newbie

Joined: 04 Aug 2014
Posts: 5

I just mistyped in my previous note. Instead of '?$format=json' it is '&$format=json'

The query string is correct and am getting the response from the REST client. But this is not working when invoked using IIB9.



http://abc.com/ods.svc/getAdvisorEligibility?dstrId=122256&dstrCtx=DMU.DIST&$format=JSON


Code:

{
    "d": {
        "statCd": "0002",
        "statDesc": "Failure",
        "AdvisorEligibility": {
            "isPrmAdvsEligInd": false
        }
    }
}
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Feb 20, 2016 12:14 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

The reason I asked is because if I am entering the URL into my browser I get a 404 page not found...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
tj
PostPosted: Sat Feb 20, 2016 11:41 am    Post subject: Reply with quote

Newbie

Joined: 04 Aug 2014
Posts: 5

The URL is not public. We cannot access it outside the network.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Feb 22, 2016 6:40 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What does a trace show for the Local Environment?

You might have to \/ the /'s, or // them or something. My memory doesn't retain that level of detail.

Also, you could use the TCP/IP monitor to create a proxy that would show you the request going out and the full response coming back.

Third, it's really kind of odd to have a JSON/REST call that uses a query string. At least in my mind.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Feb 22, 2016 6:49 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

In your browser settings, do you have a proxy setup?
Do you need to use the same proxy for your HTTP Request node?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rajamani
PostPosted: Sun Mar 06, 2016 10:05 am    Post subject: i too see almost same issue Reply with quote

Newbie

Joined: 06 Mar 2016
Posts: 3

SET OutputLocalEnvironment.Destination.HTTP.QueryString.[] = InputLocalEnvironment.HTTP.Input.QueryString.[];

Values from the Input querystring are not copied to Output query string

instead the values are assigned as NULL. I use 9.0.0.3.

it was working earlier then stopped it. i was doing some changes in the header property in the client sidelooks like some property is required from client.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun Mar 06, 2016 10:34 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Are you sure that you need the [] on both sides of the copy?

What does a UserTrace output show?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
rajamani
PostPosted: Sun Mar 06, 2016 10:58 am    Post subject: Reply with quote

Newbie

Joined: 06 Mar 2016
Posts: 3

i'm able to see the trace with values from httpinput node. but it is not populated to httprequest node. I could add additional qs with val.

it was working but some reason it stopped working.

Requirement.

html with form to get -> httpinput -> httprequest -> httpreply

httprequest node call another httpinput node with get.

I was playing in html form and meta declaration, then it stopped.
This value should be something strange, I put in Authorization field in httpRequest header, but the field came as NULL
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Mar 07, 2016 7:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What have you done to make sure that local environment gets to where it is needed ?

What does a Trace node show about the message tree that is getting sent to the HTTPRequest node ?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
rajamani
PostPosted: Mon Mar 07, 2016 7:42 am    Post subject: Reply with quote

Newbie

Joined: 06 Mar 2016
Posts: 3

I was able to assign the querystring variable to global Environment variable and I could see it in trace. when i assigned it to Output Environment to HttpRequest node, the values were assigned as NULL to another httpinput node trace.

Finally, I reset the internet explorer settings and rebooted the server. Now it is working. Looks to me some settings in the IE (windows8, IE 11) provided poison value to the queue strings.

I come again if I see the issue, also wanted to pinpoint the root cause.
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 » QueryString is not accessible using HTTPRequest node in IIB9
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.