Web Service for Activation
Though not recommended for general use, the Web Service for activation is publicly accessible.
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
[DesignerCategoryAttribute("code")]
[WebServiceBindingAttribute(Name="LicenseServiceSoap",Namespace="https://licensing.medicalconnections.co.uk/")]
[System.Reflection.Obfuscation(Exclude = true)]
internal class LicenseService : System.Web.Services.Protocols.SoapHttpClientProtocol
{
public LicenseService()
{
this.Url = "https://licenseserver1.medicalconnections.co.uk/LicenseService.asmx";
}
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("https://licensing.medicalconnections.co.uk/GetLicense",
RequestNamespace = "https://licensing.medicalconnections.co.uk/",
ResponseNamespace = "https://licensing.medicalconnections.co.uk/",
Use = System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string GetLicense(string MachineID, string Version,
string AuthenticationKey, string CustomerInfo1,
string CustomerInfo2, string LicenseType)
{
object[] results = this.Invoke("GetLicense",
new object[] { MachineID, Version, AuthenticationKey, CustomerInfo1, CustomerInfo2, LicenseType });
return ((string)(results[0]));
}
public System.IAsyncResult BeginGetLicense(string MachineID,
string Version, string AuthenticationKey, string CustomerInfo1,
string CustomerInfo2, string LicenseType,
System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("GetLicense",
new object[] { MachineID, Version, AuthenticationKey, CustomerInfo1, CustomerInfo2, LicenseType} ,
callback,
asyncState);
}
public string EndGetLicense(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
}
This can then be used by code like this:
LicenseService licensing = new LicenseService();
string result = licensing.GetLicense("1234ABCD", "8.0", "Your Licence Key", "CustInfo1", "CustInfo2", "Type");
Fallover
For increased resilience, you may modify the code to set the URL property from the calling code, and use the following endpoints in turn in case of failure.
- https://licenseserver1.medicalconnections.co.uk/LicenseService.asmx
- https://licenseserver2.medicalconnections.co.uk/LicenseService.asmx
- https://licenseserver3.medicalconnections.co.uk/LicenseService.asmx
Note
The result is either an authentication string (for use in ActivateOffline) on the target machine or a string beginning “ERROR” if there is a problem. Exceptions may of course also be thrown and may need to be caught. The MachineID (shown as 1234ABCD in the above example) needs to be obtained from a DicomLicense.MachineID on the target machine or from the Licence activation Offline tab (Detailed explanation can be found here).