Skip to Content
avatar image
Former Member

HANA XS JS Failed to send request to socket

Hi,

I'm calling a service from XS Engine in my HCP Trial Account, but I get a socket error as follows please help.

Erro Message:

Erro Message:

HttpClient.request:request failed:internal error occurred "Failed to send request to socket...rc = -1"

HttpDest

description = "Gateway for CB";
host = "hanapulp1244567trial.hanatrial.ondemand.com";
port = 443;
pathPrefix = "/ps1/PS1.xsodata/person";
proxyType = http;
proxyHost = "proxy-trial";
proxyPort = 8080;
authType = basic;
useSSL = true;
timeout = 0;
sslHostCheck = true;
sslAuth = client;
<br>

XSJS File

try {


var destination_package = "ps1";
var destination_name = "acb";
var dest = $.net.http.readDestination(destination_package, destination_name);
var client = new $.net.http.Client();
var req = new $.web.WebRequest($.net.http.GET,"?$format=json");
        req.contentType = "application/json";
	client.request(req, dest);
	var response = client.getResponse();
	var data = response.body.asString();
        var JSONObj = JSON.parse(data);
        var botR;
          for (var i = 0; i < JSONObj.d.results.length; i++) {
          botR += " ";
          botR += JSONObj.d.results[i].UID.Fname;
        }

	$.response.contentType = "application/json";
	$.response.setBody(JSON.stringify({
      "speech": botR,
      "displayText": botR
    }));
	$.response.status = $.net.http.OK;
} catch (e) {
 	$.response.contentType = "text/plain";
 	$.response.setBody(e.message);
}
<br>
I have already configured the certificate in trust store in xs/admin but 
still having the error.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers