This document is to introduce the new RESTful License Bridge to License Manager  for SAP Business One 9.0, version for SAP HANA. It is only applied for B1H 9.0, while the COM License Bridge remain as is in SAP Business One 9.0. Here you can have more details about the license bridge: 

COM License Bridge To Cobra License Manager 8.8 and 9.0

1866772 – License Service CORBA interface has been changed to RESTful interface on ‘SAP Business One 9.0, version for SAP HANA

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

  1. Rebuild the SAPBusinessOneLicense project in the sample project to obtain the SAPBusinessOneLicense.dll
  2. 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.
  3. Recompile the SAPBusinessOneLicenseSample solution (Visual Studio C#.Net 2010 are required to run this sample)

How to use the interfaces

Prerequisites:

  1. SAP Business One 9.0, version for SAP HANA or above.
  2. Visual Studio 2010 or above
  3. 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();

  1. param.wstrInstallNo = “<InstallationNo>”;
  2. param.wstrModule = “SAP-ADDONS_HDB”;;//Modules

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();

  1. userParam.wstrInstallNo = “<InstallationNo>”; //Installation No
  2. userParam.wstrModule = “SAP-ADDONS_HDB”;
  3. userParam.wstrUser = “manager”; //B1 User

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)

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Alvaro Gonzalez

    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:

    • lAvailable=86502810299924493
    • lEnd=642950282039480918
    • lNum=55834574863
    • lStart=86503347190976985
    • ReturnCode=0

    In B1H I have the next data:

    • Available=15
    • End=30/06/2014
    • Num=13
    • Start=05/05/2014

    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

    (0) 
    1. Li Ding

      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.

      • lEnd=642950282039480918 and 20140630.

      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

      (0) 
      1. Alvaro Gonzalez

        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

        (0) 
        1. Li Ding

          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

          (0) 
          1. Alvaro Gonzalez

            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

            (0) 

Leave a Reply