Unhandled Exception in GlideAjax for API Response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 07:26 AM
...Not sure where I should look to fix this error, but including both my CS and SI for help. My thought is to place multiple values into an object then stringify (convert the object to a string) and return to the client script. Not sure if this will fix the issue or not.
CS
function onLoad() {
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('Test');
ga.addParam('sysparm_name', 'CourseUtils');
ga.getXML(CourseUtilsOutput);
}
function CourseUtilsOutput(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
var objJSON = JSON.parse(answer);
for (var i = 0; i < objJSON.courses.length; i++) {
var choice = objJSON.courses[i];
g_form.addOption('course_information', choice.SUBJ_CODE + ' ' + choice.CRSE_NUMB + ' ' + choice.SEQ_NUMB, choice.TERM_DESC);
}
}
SI
var Test = Class.create();
Test.prototype = Object.extendsObject(AbstractAjaxProcessor, {
CourseUtils: function()
{
try {
var r = new sn_ws.RESTMessageV2('Banner Student', 'get');
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
return responseBody;
}
catch(ex) {
var message = ex.getMessage();
return "";
}
},
type: 'Test'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 08:24 AM
What's the error you are getting
is integration working good what did you receive in status code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 08:39 AM
Add some logs to the SI to confirm it is running, see how far it is getting, and if anything is getting returned - this error usually points to the SI not running and/or not returning anything.