cancel
Showing results for 
Search instead for 
Did you mean: 

HANA XSJS - BSP service call socket error

abhishek_rajan3
Contributor
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

abhishek_rajan3
Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi Abhishek,

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

Can you explain me please?

Regards

Fabio

abhishek_rajan3
Contributor
0 Kudos

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.

Answers (0)