Click or drag to resize

IWsDomainsSetDomainAutoRenew Method

This method enables or disables autorenew settings of a domain owned by the user.

Namespace:  Aruba.Cloud.Domains.WsDomains
Assembly:  Aruba.Cloud.Domains.WsDomains (in Aruba.Cloud.Domains.WsDomains.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult SetDomainAutoRenew(
	SetDomainAutoRenewRequest request
)

Parameters

request
Type: Aruba.Cloud.Domains.Common.Entities.WcfSetDomainAutoRenewRequest

Return Value

Type: WsResult
Examples
By using the Aruba WsDomains method SetDomainAutoRenew is possible to enable or disable autorenew settings of a dominname owned by the user.
/// WsDomains.SetDomainAutoRenew Method (c# .NET)
public static string SetDomainAutoRenew(WsDomainsClient client,
    String domainFullName, bool autoReniew)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // create the request object 
        SetDomainAutoRenewRequest request = new SetDomainAutoRenewRequest();
        request.Body = new DomainAutorenew();
        request.Body.DomainName = new InputDomainNameEntity();
        request.Body.DomainName.DomainFullName = domainFullName;
        request.Body.AutoRenew = autoReniew;

        // call method SetDomainAutoRenew 
        // obtaining a WsResult item
        WsResult result = client.SetDomainAutoRenew(request);

        //if the call is Success print history values
        if (result.Success)
        {
            // get Value returned from server
            stringBuilder.Append("Operation ends successfully. Result Code:");
            stringBuilder.Append(result.ResultCode);
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also