How to call SAP Business One Service Layer from HANA XS
As you might know our SAP Business One Service Layer provides an OData interface (see more details about Service Layer in our SAP Business One,version for SAP HANA Extensibility topics page). You can then develop applications in top of Service Layer to manage SAP Business One data.
One of the possibilities to create your own application in top of SAP HANA and Service Layer is to use SAP HANA XS (see details at Introducing…SAP HANA Extended Application Services (XS)).
In HANA XS to be able to call an https service from java script code it is required to create a destination and import the certificate into HANA XS. The following blogs provide detailed explanations how to set up the trust relation between your HANA XS application and an https service like our B1 Service Layer and how to define and call the https destination.
- Outbound httpS with HANA XS (part 1) – set up your HANA box to use SSL/TLS
- Outbound httpS with HANA XS (part 2) – set up the trust relation
Videos in youtube are also showing step by step how to proceed:
Once these steps followed you will have
- a destination file (.xshttpdest) in your HANA XS project containing details of the Service Layer destination.
Pay attention the xshttpdest need to be in the same package as the xsjs file connecting to it (see attached B1SL.xshtppdes.txt file, remove the txt extension in your project)
- an xsjs file using the destination file to call Service Layer (see attached CallSL_HTTPS.xsjs.txt file, remove the txt extension in your project).
- a TrustedStore defined via HANA XS Admin tool and attached to your destination file also via HANA XS Admin tool
and you will be able to call https B1 Service Layer from your HANA XS.
Please find attached a sample HANA XS .xsjs file (change extension to .xsjs as only .txt accepted to be attached to a blog)
Note: This trusted relation can only setup between HANA XS and B1 Service Layer from B1H 9.1 PL10 on.