Skip to Content
avatar image
Former Member

HANA XSJS web service call(cloud foundry service) error

Hi Colleagues,

This issue may seem generic, (checked a lot of scn's similar questions and post) but to no avail!

I am basically calling a web service to fetch some data hosted on cloud foundry's hana instance from my xs package(hcptrial account) but I keep getting this error

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

The spring.xshttpdest file is

host = "thedevam.cfapps.sap.hana.ondemand.com";
port = 80;
proxyType = http;
proxyHost = "proxy-trial";
proxyPort = 8080;
authType = none;
useSSL = true;
timeout = 30000;

spring.xsjs file

var destination_package = "spring";
var destination_name = "spring";

try {
       var dest = $.net.http.readDestination(destination_package, destination_name);
       var client = new $.net.http.Client();
       var req = new $.web.WebRequest($.net.http.GET, "/all"); 
       client.request(req, dest);
       var response = client.getResponse();  
       
    $.response.contentType = "application/json";
       $.response.setBody(response.body.asString());
       $.response.status = $.net.http.OK;
} catch (e) {
       $.response.contentType = "text/plain";
       $.response.setBody(e.message);
}

I've also added the cloud foundry's web service certificate in the trust store of xs hana admin portal.

When I set the "usessl" to false in the xshttpdest file, i get the following response..

Any help in this matter would be super helpful!

Regards,

Devam

capture.png (38.1 kB)
capture1.png (40.6 kB)
capture3.png (43.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 07, 2017 at 05:07 PM

    Hi -- since we've released the GA version of Cloud Foundry in the SAP CP environment, we've made a lot of progress (and also logged more discussions on answers.sap.com). Would you please re-check your report and let us know if there is still an issue as above, by entering a new question based on the GA version? Thanks for engaging!

    Add comment
    10|10000 characters needed characters exceeded