Skip to Content

Calling a java application from cloud platform in Hana XSJS using HTTP destination

Dec 05, 2017 at 12:21 PM


avatar image


I am trying to call the Java application from Cloud platform in hana xsjs but getting following error.

""Error while executing query: [HttpClient.request: request failed: internal error occurred "Failed to send request to socket...rc = -1"

HTTP Destination :




P.S : I have tested the service using the POSTMAN and it works perfectly fine.

Please let me know the error or is there any other way to connect to the java service in the Hana cloud Platform

http-dest.jpg (39.4 kB)
http-dest.jpg (39.4 kB)
xsjs.jpg (89.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Ivan Mirisola
Dec 22, 2017 at 02:53 PM

I don't see the xshttpdest file you attached here. Could you please edit the question and add this information again?

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Ivan,

I have updated the question and attached the XShttpdest and the XSJS code , We are still facing the issue . Can you help us know the issue.

Velraj Balasubramanian

Hi Velraj,

Your code looks ok to me. The only piece of information I am missing is the certificate assignment to the destination being used. Could you post which certificates you are using for that destination and how you assigned it? It is crucial that the SCP's Certificates being used are the correct ones and HANA's Certificate Store contains the full certification paths required for the SSL handshake (including the root and intermediate certificates). Here you can see that us1 certificate depends on Verizon's intermediate and DigiCert's root and they all need to be imported into the Certificate Store in HANA :

For all certification paths possible use PEM format and import it into the Certificate Store. Make sure you import each certificate one-by-one. If you are using Windows, export the certificate using PCKS#7 with all paths and then convert it to PEM format like this (you will need openSSL installed on your system):

openssl pkcs7 -inform der -print_certs -in certificate.p7b -out certificate.pem

Then, on the "XS Artifact Administration", open your package and destination. Click on Edit and modify the settings for "Authentication details" as follows:

SSL Enable: True
Trust Store: <Select the Trust Store you used to import all certification paths>
SSL Authentication Type: Client Certificate
SSL Host Check: True
Authentication Type: <choose your app authentication here - usually your java app is protected. if you really want no authentication, then create an unprotected on your web.xml - otherwise, maintain here the user and password or provide another credential> 

One you have saved your settings, you should see something like this:

I suspect that you are trying to call the HTTPS resource without the trust store selected or a proper authentication method. If this fails, your xsjs will fail immediately - thus the RC = -1. Unfortunately the JS HTTP Client doesn't get any "authentication" request errors. So that's the only message you will ever see.


certs.jpg (6.6 kB)
xsdest.jpg (37.8 kB)

Hi Ivan,

Thanks a lot for the reply , now the issue is solved and the httpdest and xsjs is working as expected.


Velraj Balasubramanian

Richard Zhao
Dec 06, 2017 at 02:26 AM

Hello, Velraj. Have you assigned the trust Stores to your HTTP Destinations? Could you refer to the link below to check, please? thanks

10 |10000 characters needed characters left characters exceeded
Mayank Gera Dec 08, 2017 at 11:22 AM

Hi Richard,

I have added the Trust store but still getting the same error.




10 |10000 characters needed characters left characters exceeded