Concurrent Licence (RAM) Relay Server
DicomObjects' concurrent licensing model allows users to set up an internal relay server using Asp.net (as a web service) which acts as a gateway for clients that do not have any Internet access. Each time a client machine sends a request out, that request is sent directly to the relay server, which in turn polls the live DicomObjects licensing server. As soon as a response is received by the relay server, it then sends that response back to the original client.
Create the ASP.Net Web Service:
public class RamService : System.Web.Services.WebService
{
[WebMethod]
public byte[] GetRamLicenseToken(string AuthorisationString, string MachineID,
string UserInfo, out string error)
{
try
{
// Consumes our online licence server's RamLicense2 web method
MCLicenseServer1.LicenseServiceSoapClient client = new MCLicenseServer1.LicenseServiceSoapClient();
var token= client.RamLicense2(AuthorisationString, MachineID, DateTime.Now.Ticks, UserInfo, out error);
if (string.IsNullOrWhiteSpace(error) && token != null)
return token;
else
{
return null;
}
}
catch (Exception ex)
{
error = ex.Message;
return null;
}
}
}
Add a reference to the Medical Connections licensing server in your relay server application
Add a reference to the web service in your client application so that it is pointing to your internal relay server
Client code pointing to your ASP.Net Web Service
if (DicomLicense.InstalledLicenses.Count == 0)
{
RamService1.RamServiceSoapClient client = new RamService1.RamServiceSoapClient();
string error = "";
// Consumes local licence server's GetRamLicenseToken web method
byte[] token = client.GetRamLicenseToken("CONCURRENT-KEY-HERE", DicomLicense.MachineID, "COMPANY NAME HERE", out error);
if (string.IsNullOrWhiteSpace(error) && token != null)
{
DicomLicense.AddRamLicense(token);
MessageBox.Show(getLicenseDetails(DicomLicense.CurrentLicense));
}
}
private string getLicenseDetails(DicomLicense l)
{
return $@"Allowed Functions: {l.AllowedFunctions}{Environment.NewLine}
AuthorisationID: {l.AuthorisationID}{Environment.NewLine}
Expiry Date: {l.Expiry.ToString("yyyy-MM-dd HH:mm:ss")}{Environment.NewLine}
IsRamLicense: {l.IsRamLicense}{Environment.NewLine}
License ID: {l.LicenseID}{Environment.NewLine}
License Token: {l.LicenseToken}{Environment.NewLine}
License Type: {l.LicenseType}{Environment.NewLine}";
}
Each time a workstation RAM licence expires, the client will request a new key directly from your relay server, which in turn will poll the online Medical Connections server.