Web Service for Activation

Though not recommended for general use, the Web Service for activation is publicly accessible using the following code:

using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;

[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name = "LicenseServiceSoap", 
         Namespace = "http://licensing.medicalconnections.co.uk/")]
[System.Reflection.Obfuscation(Exclude = true)]
internal class LicenseService : System.Web.Services.Protocols.SoapHttpClientProtocol
{
   /// <remarks/>
   public LicenseService()
   {
       this.Url = "http://licenseserver1.medicalconnections.co.uk/LicenseService.asmx";
   }

   /// <remarks/>
   [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://licensing.medicalconnections.co.uk/GetLicense", 
       RequestNamespace = "http://licensing.medicalconnections.co.uk/", 
       ResponseNamespace = "http://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]));
   }

   /// <remarks/>
   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);
   }

   /// <remarks/>
   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", "5.5", "Your Key", "CustInfo1", "CustInfo2", "Workstation");

For increased resilience, you may modify the code to set the Url property from the calling code, and use the following values in turn until you find one which is functioning!

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 generated from a call to DicomLicense.MachineID on the target machine.

Relevance: