Phone sales support +39 0575 05077
  Phone technical support +39 0575 0508
 

5.2 Delete a License

Removing a purchased license in the Active status.
By using the Aruba WsLicense method SetRemoveLicense, it is possible to remove a license, if associated to the account with which the call is made to the method.
If the license you wish to remove is associated to another account, you will receive an error message and the operation will not be completed.
Removal of the license cannot be completed if there is currently an operation in relation to the license, in queue with a status other than Error or Completed.

Parameters
licenseId
Type: Int32
Int32 type item which represents the ID of the license to be removed.

Returns
The method returns a WsResult item with information on the result of the call to the method.
//IWsLicense.SetRemoveLicense Method (c# .NET)
private static void SetRemoveLicense(WsLicenseClient client, int licenseId)
{
    //specify the account login details
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    try
    {
        //call method SetRemoveLicense,
        //obtaining a WsResult item
        var result = client.SetRemoveLicense(licenseId);

        //if the call is not successful, re-run the error indicating the message
        if (!result.Success)
            throw new ApplicationException(result.ResultMessage);
    }
    catch (Exception ex)
    {
        //re-run the generic error
        throw new ApplicationException(ex.Message);
    }
}
//IWsLicense.setRemoveLicense Method (JAVA)
private static void SetRemoveLicense(IWsLicense client, int licenseId)
{
    //specify the account login details
    ((BindingProvider)client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");	
    ((BindingProvider)client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");	

    try
    {
        //call method setRemoveLicense,
        //obtaining a WsResult item
        WsResult result = client.setRemoveLicense(licenseId);
        
        //if the call is not successful, re-run the error indicating the message
        if (result.isSuccess()) 
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //re-run the generic error
        System.out.println(ex.getMessage());
    }
}
Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsLicense/v2.8/WsLicense.svc?wsdl
See also

Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsLicense/v2.8/WsLicense.svc?wsdl