Labs64 / NetLicensing-Community

NetLicensing Community Support
https://netlicensing.io
MIT License
5 stars 1 forks source link

About licensee validation #8

Closed drazendjolovic closed 3 years ago

drazendjolovic commented 3 years ago

Hi, In our application we are using NetLicensingClient-csharp nuget package version 2.4.6.

We notice that function validate (LicenseeService.validate(...)) doesn't have same print like before. Previously it had 5 params (contex, licenceNumber, ValidationParameters, SessionId, action), now it have only first three (without sessionId and action) and as validation result we don't get floating productModul only subscription. Is there a way to check validation of floating productModule or we must take older version.

Thanks in advance

r-brown commented 3 years ago

Hello,

Possibly there is a small confusion - LicenseeService class wasn't changed in regards to this method signature since 2014! - see changelog as a reference - https://github.com/Labs64/NetLicensingClient-csharp/commits/master/NetLicensingClient/LicenseeService.cs

Handling of Licensing Model specific attributes (such as Floating or Node-Locked) is being done in the ValidationParameters class.

Typical usage for this scenarion would be as below:

ValidationParameters validationParameters = new ValidationParameters();
validationParameters.setLicenseeName(ourLicenseeName);
validationParameters.setProductNumber(ourProductNumber);

validationParameters.put(ourProductModuleNumber, "sessionId", "sess001");
validationParameters.put(ourProductModuleNumber, "action", "checkOut");

ValidationResult validationResult = LicenseeService.validate(context, ourLicenseeNumber, validationParameters);

This class is taking care of necessary attributes indexing accordingly to the REST API documentation. See also related issue: Labs64/NetLicensingClient-csharp/issues/28

drazendjolovic commented 3 years ago

Thank you R-Brown. The problem was that earlier I put "sessionId" and "action" directly like function parameters. Now I must send them throw "validationParameters" (I didn't know that). Thanks again. Problem solved...