Click or drag to resize

IWsDomainsGetIsAvailableDomainNameFree Method

The method returns a list of domains available to be purchased 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<List<DomainAvailabilityEntity>> GetIsAvailableDomainNameFree(
	GetIsAvailableDomainRequest request
)

Parameters

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

Return Value

Type: WsResultListDomainAvailabilityEntity
The method returns an object containing information on the outcome WsResultOfArrayOfDomainAvailabilityEntity. The Value property for instance returns a List<DomainAvailabilityEntity>.
Examples
The following example describes a method, called GetIsAvailableDomainNames(), which means a call to GetIsAvailableDomainNameFree() to Aruba WsDomains, get a list of objects of class DomainAvailabilityEntity. The list thus obtained is cycled so as to extract, the information about available domains. In the specific case of the example a list of available domain names is extracted.

This list of available domain names being cycled so as to extract a list of domain full names available.

// Returns a list of string that displays the available domain names
private String GetIsAvailableDomainNames(string domainFullName)
{
    StringBuilder sb = new StringBuilder();
    var domainsClient = serviceManager.GetDomainsClient();
    var availabilityResult = domainsClient.GetIsAvailableDomainNameFree(new GetIsAvailableDomainRequest
    {
        Body = new InputDomainNameEntity
        {
            DomainFullName = domainFullName
        }
    });
    if (availabilityResult.Success)
    {
        foreach(var ar in availabilityResult.Value)
        {
            sb.Append(ar.DomainName.DomainFullName);
        }
    }
    else
    {
        throw new ApplicationException(String.Format("An error has occurred while invoking GetIsAvailableDomainNameFree(). This is the inner exception: {0}", result.ResultMessage));
    }
    return sb.ToString();
}
See Also