Skip to Content

HANA XSJS - BSP service call socket error

Oct 10, 2017 at 08:41 AM


avatar image

Dear all,

We have created a BSP application in our ECC (on HANA) system to use a function module returning a table. This BSP URL is then called in the XSJS service as per the guidelines in the wonderful video presentation by Thomas Jung:

However, we are getting error "Failed to send request to socket...rc = -1", when calling the webservice. Below is the http dest and XSJS file details:

HTTP Dest -

description = "Test HTTP Dest ABR"; host = ""; port = 80; pathPrefix = "/sap/bc/bsp/sap/zhana_bsp_abr/test_bsp_abr.htm"; proxyType = none; useProxy = false; proxyHost = ""; proxyPort = 0; authType = basic; useSSL = true; timeout = 0; sslHostCheck = true; sslAuth = anonymous;

The destination lies in the same network so proxy is false.

XSJS file -

function testABR(){ $.response.contentType = "application/json"; var dest = $.net.http.readDestination("XSPOC", "test_abr"); var client = new $.net.http.Client(); var req = new $.web.WebRequest($.net.http.GET, ''); client.request(req, dest); var response = client.getResponse(); var body; if (response.body){body = response.body.asString(); } $.response.status = response.status; $.response.setBody(body) ; } testABR();

We have found several answers on SAP Answers but nothing fits this scenario.

Please suggest in case you have any pointers.


Abhishek Rajan.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Abhishek Rajan Oct 24, 2017 at 11:58 AM

Hi all,

We were able to resolve it by creating a trust store in the XS Trust Center and importing the destination system certificate to it.



Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Abhishek,

I have the same problem that you describe, but I don't undestand your resolution.

Can you explain me please?




Hi Fabio,

Apologies for the late response.

You can go to the XS Admin web https://<server>:4300/sap/hana/xs/admin

Here, look for the 'Trust Manager' in the left menu option. A new Trust Store has to be created and in the certificate list, you need to import the server certificate for the destination application server you are configuring for your XS application. For us, our SAP ECC where the BSP page is created is the target application server.

You also need to add the 'Own Certificate' which identifies the HANA server.

These actions can be done once you have the sap.hana.xs.admin::TrustStoreAdministrator access added to your user.