This document is to introduce the new RESTful License Bridge to License Manager since SAP Business One 9.0, applied for both MS SQL version and SAP HANA version.
Sample Project Download:
Sample Code of new RESTful License Bridge to License Manager for B1H 9.0
The sample project is available as attachment for downloaded at the end of this document. It is constituted of:
-SAPBusinessOneLicense project: The RESTful License Bridge, output as “SAPBusinessOneLicense.dll”
-CSharp_Sample: A C# sample project of using the RESTful License Bridge
-VBNet_Sample: A VB.Net sample project of using the RESTful License Bridge
How to use the RESTful License Bridge in your project
- Rebuild the SAPBusinessOneLicense project in the sample project to obtain the SAPBusinessOneLicense.dll
- Import SAPBusinessOneLicense.dll for your own project where you want to use the RESTful license bridge of SAP Business One 9.0, version for SAP HANA.
- Recompile the SAPBusinessOneLicenseSample solution (Visual Studio C#.Net 2010 are required to run this sample)
How to use the interfaces
Prerequisites:
- SAP Business One 9.0 or above.
- SAP Business One 9.0, version for SAP HANA or above.
- Visual Studio 2010 or above
- Microsoft DoNet Framework 4.0 or above
It is not recommended to the RESTful license bridge in a multi-thread circumstance, for he SAPBusinessOneLicense.dll is not built as a thread-safe library.
Here list all the interfaces of the RESTful license bridge for SAP Business One 9.0 version for SAP HANA. Please refer to SDK Online Help Center for more details.
Class or Interfaces |
Description and Sample code |
LicenseHelper class |
This is first step to use the new RESTful COM Bridge to License Manager: Connecting to license server, the protocol must be https, and the port is 40000. LicenseHelper license = new LicenseHelper(“https://<License_Server_Address>:40000/license/”); |
GetHardwareKey() |
Get the hardware key of the license server var result = license.GetHardwareKey(); |
GetLicenseInfoParam class |
Get the License Information GetLicenseInfoParam param = new GetLicenseInfoParam();
var rm = license.GetLicenseInfo(param); |
GetLicenseInfo(param) |
|
GetSystemNumberParam |
Get System Number: GetSystemNumberParam param1 = new GetSystemNumberParam(); param1.sInstallNo = “SAP-INTERN”; var rm1 = license.GetSystemNumber(param1); |
GetSystemNumber(param) |
|
GetLicenseNumParam |
Get License Number: GetLicenseNumParam param2 = new GetLicenseNumParam(); param2.wstrKey = “SAP-ADDONS_HDB”; param2.wstrInstallNo = “SAP-INTERN”; var rm2 = license.GetLicenseNum(param2); |
GetLicenseNum |
|
IsUserLicensedParam class |
Check if user is licensed IsUserLicensedParam userParam = new IsUserLicensedParam();
var isUserLid = license.IsUserLicensed(userParam); |
IsUserLicensed(param) |
|
LoadLicenseFileParam |
LoadLicenseFileParam param3 = new LoadLicenseFileParam(); //Put your license string here: param3.NewLicenseFile = “—– Begin SAP License —–\r\nSAPSYSTEM=B01”; var rm3 = license.LoadLicenseFile(param3); |
LoadLicenseFile(param) |
Hello Yatsea Li
I am testing the example modify the values for GetLicenseInfo
The wstrInstallNo parameter I take it from INSTNO of B01_multiple.txt
and the wstrModule parameter I take it from SWPRODUCTNAME of B01_multiple.txt
When I get the information the GetLicenseInfoResult give me the next results:
In B1H I have the next data:
I think I am doing something wrong or I need to make a CAST or something, but I don´t know where I can get information
Can you give me some information?
Regards
Alvaro
hi Alvaro Gonzalez,
I tried on my side and everything is OK.
I am checking your INum,
INum = 55834574863 = 1101 0000 0000 0000 0000 0000 0000 0000 1111
and Num = 13 = 0000 0000 0000 0000 0000 0000 0000 0000 1101
notice that 1101 are the same and the rest are all 0000 or 1111.
Also you can compare , convert below int to bit array (64 bit) and may find the low 32 bit are exactly the same.
So i suspect are this error happens because format convert?
I would like to know how do you use this sample project, are you using a Int64 as default instead of Int32 ? The more detail, the better.
Thanks.
Li
Hello Li Ding
I am compiling my project with x86 option, the code runs over PC 64 bits, let me show you my test code:
Dim license As SAPBusinessOneLicense.LicenseHelper
license = New APBusinessOneLicense.LicenseHelper("https://HANA:40000/license/")
Dim param As GetLicenseInfoParam
param = New GetLicenseInfoParam()
param.wstrInstallNo = "INSTNO" 'from B01_multiple.txt
param.wstrModule = "SWPRODUCTNAME" 'from B01_multiple.txt
Dim RESparam As GetLicenseInfoResult
RESparam = license.GetLicenseInfo(param)
And I am getting the value 51539607567 for lNum parameter
Regards
Alvaro
hi Alvaro,
Sorry for late reply, have you tried to compile with x86 option and run over 86 bit OS? Or with x64 option over 64 bit OS?
Thanks,
Li
Hello!!!
We updated the HANA Server to PL 11 and everything works fine. Now I have the correct information
Thank you for your support Li
Alvaro