REST request.getRequestBody() & response.getQueryString() do not work on scripted REST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 05:32 AM
Hi,
I cannot get this to work at all.
any help would be appreciated
response = sm.executeAsync(); //Might throw exception if http connection timed out or some issue with sending request itself because of encryption/decryption of password.
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.
responseBody = response.haveError() ? response.getErrorMessage() : response.getBody();
status = response.getStatusCode();
}
catch(ex)
{
responseBody = ex.getMessage();
status = '500';
}
finally
{
requestBody = sm ? sm.getRequestBody():null;
}
workflow.info("Request Body: " + requestBody);
workflow.info("Request Body: " + response.getQueryString());
workflow.info("Response: " + responseBody);
workflow.info("HTTP Status: " + status);
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 02:34 PM
Hello Shay,
Please refer sample example in the below link and adjust your code accordingly.
Scripted REST API example - script samples
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2017 01:15 AM
Hi,
i am executing a REST message and need to know what the outbound URL is that is being sent.
it is a scripted outbound rest i have not a rest api.
Thanks,
Shay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2017 01:33 AM
Hi Shay,
Try this code.
request.queryString
request.body
and check whether this is returning values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2017 04:03 AM
Hi Shay,
Where are you executing this code.
Regards
Param