Dear Experts,
I am currently struggeling with calling the sap metadata api inside my XSJSLib. It allways returns the status code 303. The redirected url points to an sap hana login form.
I have configured my httpDest in the same package as my script and in the sap hana xs admin tools I have provided my credientials for the httpdest.
This is my xsjs code:
function runRequest(path, headers, destName, callback){
var obj = {};
try{
var destination = $.net.http.readDestination(dest_lib[destName], destName);
var client = new $.net.http.Client();
var request = new $.web.WebRequest($.net.http.GET, path);
var h;
for(h in headers){
if(headers.hasOwnProperty(h)){
if(h === "Service"){
request.headers.set("Service-Name", headers[h].toString());
}else{
request.headers.set(h, headers[h].toString());
}
}
}
var response = client.request(request, destination).getResponse();
obj.headers = response.headers;
callback(obj, null);
}catch(err){
callback(null, err);
}
}
This is my httpdest:
description = "search result";
host = "xxx";
port = 8000;
description = "search result";
useSSL = false;
pathPrefix = "/sap/hana/xs/dt/base/metadata/search_result";
authType = basic;
useProxy = false;
proxyHost = "";
proxyPort = 0;
timeout = 3;
authType = basic;
useSSL = false;
timeout = 3;
Here I had provided my login data --> see pic1 attachment. It seems to be that my changes are saved. At least I could change other values due the hana xs cockpit but still an error is occuring in the cokpit ui --> see pic2. The error message is an internal Server error code 500.posts
I have read a several posts where just the credentials were missing. But this shouldnt be the case. Even if I provide wrong credentials there is no Status change. Any idea about this?
Best regards, Justus