Skip to Content

HANA XSJS - BSP service call socket error

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:

https://www.youtube.com/watch?v=fWirvj9l7eY

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 = "XXXX.XXXX.net"; 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.

https://answers.sap.com/questions/154640/hana-xs-js-failed-to-send-request-to-socket.html

https://answers.sap.com/questions/170725/hana-xs-js-web-service-call-error-request-failed.html

https://answers.sap.com/questions/81012/hana-xs-js-web-service-call-error.html

Please suggest in case you have any pointers.

Regards,

Abhishek Rajan.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    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.

    Regards,

    Abhishek.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

      Regards,

      Abhishek.