Click or drag to resize
DecrementLicenseCounter Class
Implements the XmlActivationService web service's DecrementLicenseCounter method to decrement the License Counter value of a license.
Inheritance Hierarchy
SystemObject
  com.softwarekey.Client.WebServiceWebServiceCall
    com.softwarekey.Client.WebService.XmlActivationServiceDecrementLicenseCounter

Namespace: com.softwarekey.Client.WebService.XmlActivationService
Assembly: PLUSManaged (in PLUSManaged.dll) Version: 5.19.3.0
Syntax
public class DecrementLicenseCounter : WebServiceCall

The DecrementLicenseCounter type exposes the following members.

Constructors
  NameDescription
Public methodDecrementLicenseCounter(AuthorEncryptionKey)
Creates a new DecrementLicenseCounter object.
Public methodDecrementLicenseCounter(XmlActivationService, AuthorEncryptionKey)
Creates a new DecrementLicenseCounter object.
Top
Properties
  NameDescription
Public propertyClassName
Gets or sets the class name of the WebServiceClient object.
(Inherited from WebServiceCall.)
Public propertyDeactivationDate
Gets the Deactivation Date of the installation. If the installation is not deactivated the value will be MinValue.
Public propertyDecrementAmount
Sets the amount to decrement the License Counter. The Default value is 1.
Public propertyEncryptionKey
Gets or sets the author encryption key data.
(Inherited from WebServiceCall.)
Public propertyErrorMessage
Gets or sets the error message returned by the web service method call. (See http://www.softwarekey.com/go/?ID=20 for a list of possible values.)
(Inherited from WebServiceCall.)
Public propertyInstallationID
Gets or sets the Installation ID (required), which is a unique identifier for the given activation which was issued.
Public propertyLastError
Gets or sets the last error which occurred.
(Inherited from WebServiceCall.)
Public propertyLicenseCounter
Gets the License Counter value returned from the server.
Public propertyMethodName
Gets or sets the name of the method which will be called from the WebServiceClient object.
(Inherited from WebServiceCall.)
Public propertyRequireSsl
Gets or sets whether or not SSL certificate validation to check.
(Inherited from WebServiceCall.)
Public propertyResultCode
Gets or sets the result code returned by the web service method call. (See http://www.softwarekey.com/go/?ID=20 for a list of possible values.)
(Inherited from WebServiceCall.)
Public propertySessionCode
Gets or sets the randomized session code (used to deter replay attacks).
(Inherited from WebServiceCall.)
Public propertySessionCodeValidation
Gets or sets whether or not session code validation should be done automatically.
(Inherited from WebServiceCall.)
Public propertyUseDigitalSignature
Gets or sets whether or not a digital signature is to be used or is required for the web service call. (This can only be set to false if UseEncryption is already set to false.)
(Inherited from WebServiceCall.)
Public propertyUseEncryption
Gets or sets whether or not encryption is to be used or is required for the web service call.
(Inherited from WebServiceCall.)
Public propertyWebServiceClient
Gets or sets the SoapHttpClientProtocol object (.NET Framework) or the XmlWebService object (.NET Standard 2.0) used to perform the web service method call.
(Inherited from WebServiceCall.)
Public propertyWebServiceResponse
Gets or set the XmlNode object reference for the root XML node of the web service response.
(Inherited from WebServiceCall.)
Top
Methods
  NameDescription
Protected methodAppendSessionCode(String)
Appends the SessionCode value to an XML request string depending on the SessionCodeValidation setting, and returns the updated XML string
(Inherited from WebServiceCall.)
Protected methodAppendSessionCode(XmlDocument)
Appends the SessionCode value to an XmlDocument depending on the SessionCodeValidation setting, and returns the updated XML string
(Inherited from WebServiceCall.)
Public methodCallWebService
Calls the web service method.
(Inherited from WebServiceCall.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGenerateEncryptedRequest
Generates an encrypted web service call XML request string.
(Inherited from WebServiceCall.)
Public methodGeneratePlainTextRequest
Generates a plain-text XML request string for DecrementLicenseCounter calls.
(Overrides WebServiceCallGeneratePlainTextRequest.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodProcessResponse(String)
Processes a web service response XML string.
(Inherited from WebServiceCall.)
Public methodProcessResponse(XmlNode)
Processes a web service response.
(Overrides WebServiceCallProcessResponse(XmlNode).)
Public methodResetSessionCode
Sets the SessionCode value to a new, randomized value.
(Inherited from WebServiceCall.)
Public methodToString (Inherited from Object.)
Public methodValidateWebServiceResponseFormat
Verifies the format of the response received is such that expected and required content can be found and parsed.
(Inherited from WebServiceCall.)
Top
Remarks

The XmlActivationService documentation should be referenced for the most current information.

Caution note Caution

Any Product Options in SOLO Server which you intend to use when issuing License IDs which will be validated with this method must have the "Issue Installation ID" option enabled, and must be activated with ActivateInstallation or ActivateInstallationLicenseFile. Please refer to the SOLO Server manual for details.

Examples
This example shows how to make a typical activation call for a PLUSManaged license:
public bool DecrementLicenseCounterOnline(AuthorEncryptionKey encryptionKey,
    string installationId, ref licenseCounter, ref LicenseError lastError)
{
    //make sure we have an Installation ID to use first
    if (string.IsNullOrEmpty(installationId))
    {
        lastError = new LicenseError(LicenseError.ERROR_INSTALLATIONID_REQUIRED);
        return false;
    }

    DecrementLicenseCounter ws = new DecrementLicenseCounter(encryptionKey);
    ws.InstallationID = installationId;
    ws.DecrementAmount = 1;

    XmlActivationService client = new XmlActivationService();
    // If you are using SOLO Server Dedicated URL or a self-hosted instance of SOLO Server,
    // set the client.Url property here.  You may also configure proxy settings on this object here, if necessary.
    ws.WebServiceClient = client;

    if (!ws.CallWebService())
    {
        lastError = ws.LastError;
        return false;
    }

    licenseCounter = ws.LicenseCounter;
    return true;
}
See Also