- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2018 11:33 PM
I have a rest message with POST method, rest message is running and giving result in test run. but when I am trying to run this using scheduled job it gives me error.
I wrote this:
var r = new sn_ws.RESTMessageV2('RestMessage','post');
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
var parser = new global.JSONParser();
var parsed = parser.parse(responseBody);
I get the error:
REST Msg Outbound - RESTMessageClient : Error constructing REST Message/Method: global.legalholdpro/post: com.glide.generators.InvalidGlideRecordException: REST message/method 'global.legalholdpro/post' not found in table 'sys_rest_message_fn': com.glide.rest.outbound.RESTMessageDAO.getMethodRecord(RESTMessageDAO.java:97)
com.glide.rest.outbound.RESTMessageDAO.<init>(RESTMessageDAO.java:72)
com.glide.rest.outbound.RESTMessageDAO.newInstance(RESTMessageDAO.java:67)
also I need to push the results which is in JSON format in a staging form, which will work after rest gets executed. Please suggest?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2021 07:35 AM
This worked for me:
var Url = 'https://www.testurl.com/';
var request = new sn_ws.RESTMessageV2();
request.setHttpMethod('post');
request.setEndpoint(Url);
request.setRequestHeader("Content-type",'application/json');
request.setRequestHeader("Authorization",'Bearer YYNp0IIJozbzfUV9');
var response = request.execute();
var httpResponseStatus = response.getStatusCode();
var httpResponseContentType = response.getHeader('Content-Type');
//Debug the results:
gs.debug("http response status_code: " + httpResponseStatus);
gs.debug("http response content-type: " + httpResponseContentType);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2018 11:40 PM
Hi
PFB the link where your issue is explained.
Mark Correct if it helps.
Warm Regards,
Omkar Mone
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2018 11:56 PM
tried and referred this article, still not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2018 12:23 AM
Where is your REST message defined ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2018 02:00 AM
Not sure if I understood your question, its under rest messages and in job I am calling it.