Notifications

17 views

Description

This KB is for developers who have come across ExceptionĀ  ""Illegal access to outbound HTTP in Security Incident Response." when triggering a REST message update of the current record with a business rule.

Release or Environment

All

Cause

Due to the remote server, not always responding quickly enough, the script fails with the "Illegal access to outbound HTTP in Security Incident Response."

That is because the REST API call/ update is not fast enough to get processed real time and it times out

Resolution

The REST call must be asyncronously porcessed with the following code using RESTmessageobj.executeAsync() instead of RESTmessageobj.execute()

try {
var r = new sn_ws.RESTMessageV2('REST MESSAGE NAME HERE', 'post');
r.setStringParameterNoEscape('id', VARIABLE FOR ID HERE');

var response = r.executeAsync();
response.waitForResponse(10);

var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
this.json = new global.JSON().decode(responseBody);

Article Information

Last Updated:2020-02-24 04:03:43
Published:2020-02-24