- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
If you happen to run into the following error within a scoped application: Error constructing REST Message/Method: The chances are you need to dereference the global namespace for your REST Message name.
Here are the symptoms of this behavior. You create a REST Message in global scope that is accessible to all Application Scopes. You test it using the Test Related Link.
It returns a beautiful 200 HTTP Status Code. You use the Preview Script Usage and copy the contents to use within a scoped application. It doesn't work. You get the Error constructing REST Message/Method:.
You need to prefix your REST Message name with global (like so):
try {
var r = new sn_ws.RESTMessageV2('global.rest_message_name', 'get');
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
}
catch(ex) {
var message = ex.getMessage();
}
- 5,518 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.