Click or drag to resize

IWsDomainsGetAllDomains Method

The method retrieves all active domains owned by the authenticated 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<List<RegisteredDomainDataEntity>> GetAllDomains(
	WsRequest request
)

Parameters

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

Return Value

Type: WsResultListRegisteredDomainDataEntity
Examples
By using the Aruba WsDomains method GetAllDomains is possible to retrieve all active domains owned by the authenticated user..
/// WsDomains.GetAllDomains Method (c# .NET)
public static string GetAllDomains(WsDomainsClient client)
{
    //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
        WsRequest request = new WsRequest();

        // call method GetAllDomains 
        // obtaining a WsResultOfArrayOfRegisteredDomainDataEntity item
        WsResultOfArrayOfRegisteredDomainDataEntity result = 
            client.GetAllDomains(request);

        // if the call is Success print returned values
        if (result.Success)
        {                    
            stringBuilder.Append("Operation ends successfully\n");

            // get Value returned from server
            RegisteredDomainDataEntity[] domains = result.Value;

            // for each domain print the information
            foreach (RegisteredDomainDataEntity domain in domains)
            {
                stringBuilder.Append("\n-------------------");
                stringBuilder.Append("\nDomain UserID: ");
                stringBuilder.Append(domain.UserID);
                stringBuilder.Append("\nDomain CompanyID: ");
                stringBuilder.Append(domain.CompanyID);
                stringBuilder.Append("\nDomain DataCenterID: ");
                stringBuilder.Append(domain.DataCenterID);

                stringBuilder.Append("\nDomain FullName: ");
                stringBuilder.Append(domain.DomainName.DomainFullName);
                if (domain.DomainName.PreferredLanguage.HasValue)
                {
                    stringBuilder.Append("\nDomain PreferredLanguage: ");
                    stringBuilder.Append(domain.DomainName.PreferredLanguage.Value);
                }

                stringBuilder.Append("\nDomain SecondLevelDomain: ");

                stringBuilder.Append("\nDomain DomainServiceID: ");
                stringBuilder.Append(domain.DomainServiceID);
                if (domain.CreationDate.HasValue)
                {
                    stringBuilder.Append("\nDomain CreationDate: ");
                    stringBuilder.Append(
                        domain.CreationDate.Value.ToLongDateString());
                }
                if (domain.ExpiryDate.HasValue)
                {
                    stringBuilder.Append("\nDomain ExpiryDate: ");
                    stringBuilder.Append(
                        domain.ExpiryDate.Value.ToLongDateString());
                }
                stringBuilder.Append("\nDomain AutoRenew: ");
                stringBuilder.Append(domain.AutoRenew);
                if (domain.CloudExpiryDate.HasValue)
                {
                    stringBuilder.Append("\nDomain CloudExpiryDate: ");
                    stringBuilder.Append(d
                    omain.CloudExpiryDate.Value.ToLongDateString());
                }
                if (domain.LastRenewDate.HasValue)
                {
                    stringBuilder.Append("\nDomain LastRenewDate: ");
                    stringBuilder.Append(
                        domain.LastRenewDate.Value.ToLongDateString());
                }
                stringBuilder.Append("\nDomain PrivacyStatus: ");
                stringBuilder.Append(domain.PrivacyStatus);
                stringBuilder.Append("\nDomain Status: ");
                stringBuilder.Append(domain.Status);

            }
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also