cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

Hi,

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 :

XSJS Code

URL

https://**********.us1.hana.ondemand.com/MailerService/MailServlet

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

0 Kudos

Hi Velraj,

I have a issue where I am unable to call a service on the SAP Cloud Platform from XSJS(on SCP HANA).

It would be great if you could share the final version of how you have set up the destination.

Regards,
Sruti

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

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

0 Kudos

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.

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

Regards,
Ivan

0 Kudos

Hi Ivan,

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

Thanks,

Velraj Balasubramanian

Answers (2)

Answers (2)

mayankgera
Explorer
0 Kudos

Hi Richard,

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

403

Thanks,

Mayank

richard-zhao
Employee
Employee
0 Kudos

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

https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/0cb7e601bac244f0820dfc4b286...