- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 10:08 AM
Hi All
How to make my rest call to wait until it responds. since the web service will responds after some time. I am using asynchronous Calls. Could you please suggests how to make it wait.
I tried
setHttpTimeout(10000),
waitForResponse(60).
The Problem is , I couldn't able to finish the request until it responds, i mean it taking too long to submit the service catalog request.
Solved! Go to Solution.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2016 04:19 PM
An Event has two parameters you can use to pass values.
gs.eventQueue('event_name', current, 'parm1', 'parm2');
If you need to pass more values, and you're familiar with JavaScript Objects, you can always pass a JSON string.
gs.eventQueue('event_name', current, '{"name1":"value1","name2":"value2","name3":"value3"}', 'parm2');
Then from your Script Action, you call the parameters like this (assume parm1 is a User's sys_id):
var user = new GlideRecord('sys_user');
if (user.get(event.parm1)) {
// Do stuff here
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 10:23 AM
anyone, please does suggest me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 10:03 PM
Hi Dilip,
As per this documentation link waitForResponse(60); could be the right choice for you.
Asynchronous RESTMessageV2 example
..
response.waitForResponse(60);// In seconds. Wait at most 60 seconds to get response from ECC Queue/Mid Server //Might throw exception timing out waiting for response in ECC queue.
..
Are you checking the response ? If so what is the response?
..
responseBody = response.haveError() ? response.getErrorMessage() : response.getBody();
..
Best Regards
Tony

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 11:43 PM
Hi dilip,
Can you describe your scenario a bit more, step by step? I'm not sure what you're doing or what the issue is.
It sounds like a REST web service is triggered when you submit a Catalog Item, but it's causing the form to take too long to submit. Is that correct?
How are you triggering the web service?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 12:01 PM
Hi Geoffrey,
Thanks for your email!
let me explain,
I have a Catalog item which trigger's a Rest service to delete a service. since Delete takes extra time my Rest service is not able to respond quickly, it takes 2-3 minutes to get the response.
here the problem , once order button clicked , my screen is frozen for 2-3 until it responds, to over that what can I do!
I have used a business rule to make to trigger service, also tried client script and script include by no luck