Skip to Content
0
Former Member
Aug 30, 2017 at 01:22 PM

500 - Internal server error - XSJS Service

766 Views Last edit Aug 30, 2017 at 01:46 PM 2 rev

Hi All,

I've been getting an "Error 500 - Internal Server Error" for my XSJS Application. I'm quite not sure where I can start finding the error. The API we're calling is in "https".

Please see code below for my XSJS.

var eid = $.request.parameters.get("eid");

var baseURL = "eid="; var destination = $.net.http.readDestination("YTM_CONFLR", "YTM_GetGUID");

var client = new $.net.http.Client();

var request = new $.net.http.Request($.net.http.GET, baseURL + eid);

var response = client.request(request, destination).getResponse();

var guid = JSON.parse(response.body.asString()).guid;

var conn = $.db.getConnection();

var pstmtGuid = conn.prepareStatement('INSERT INTO "YTM_S_CONFLR"."YTM_CONFLR.data::YTM_DDL.YTM_T_GUID" ("eid", "guid") VALUES (?, ?)');

pstmtGuid.setString(1, 'marvin.g.tulagan');

pstmtGuid.setString(2, guid.myActivitiesGUID);

pstmtGuid.execute();

pstmtGuid.close();

conn.commit();

conn.close();

EDIT: I still haven't done configuring the Outbound HTTPS since the API didn't gave me an API Key for this.