Author |
Message
|
tj |
Posted: Fri Feb 19, 2016 12:53 pm Post subject: QueryString is not accessible using HTTPRequest node in IIB9 |
|
|
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 |
|
 |
fjb_saper |
Posted: Fri Feb 19, 2016 1:55 pm Post subject: |
|
|
 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 |
|
 |
tj |
Posted: Fri Feb 19, 2016 2:32 pm Post subject: |
|
|
Newbie
Joined: 04 Aug 2014 Posts: 5
|
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Feb 20, 2016 12:14 am Post subject: |
|
|
 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 |
|
 |
tj |
Posted: Sat Feb 20, 2016 11:41 am Post subject: |
|
|
Newbie
Joined: 04 Aug 2014 Posts: 5
|
The URL is not public. We cannot access it outside the network. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 22, 2016 6:40 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Mon Feb 22, 2016 6:49 am Post subject: |
|
|
 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 |
|
 |
rajamani |
Posted: Sun Mar 06, 2016 10:05 am Post subject: i too see almost same issue |
|
|
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 |
|
 |
smdavies99 |
Posted: Sun Mar 06, 2016 10:34 am Post subject: |
|
|
 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 |
|
 |
rajamani |
Posted: Sun Mar 06, 2016 10:58 am Post subject: |
|
|
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 |
|
 |
mqjeff |
Posted: Mon Mar 07, 2016 7:33 am Post subject: |
|
|
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 |
|
 |
rajamani |
Posted: Mon Mar 07, 2016 7:42 am Post subject: |
|
|
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 |
|
 |
|