Click or drag to resize

IWsDomainsGetDomainWhois Method

Returns result of a public whoiscall using a domain name.

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<DomainWhoisEntity> GetDomainWhois(
	GetDomainWhoisRequest request
)

Parameters

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

Return Value

Type: WsResultDomainWhoisEntity
Examples
By using the Aruba WsDomains method GetDomainWhois is possible to make a public whoiscall using a domain name.
/// WsDomains.GetDomainWhois Method (c# .NET)
public static string GetDomainWhois(WsDomainsClient client,
    String domainFullName)
{
    //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 
        GetDomainWhoisRequest request = new GetDomainWhoisRequest();
        request.Body = new InputDomainNameEntity();
        request.Body.DomainFullName = domainFullName;

        // call method GetDomainWhois 
        // obtaining a WsResultOfDomainWhoisEntity item
        WsResultOfDomainWhoisEntity result = client.GetDomainWhois(request);

        //if the call is Success print history values
        if (result.Success)
        {
            // get Value returned from server
            stringBuilder.Append(" Operation ends successfully.\n");
            DomainWhoisEntity item = result.Value;

            stringBuilder.Append("\nDomainFullName : ");                   
            stringBuilder.Append(item.DomainName.DomainFullName);
            stringBuilder.Append("\nWhoisResponse : ");                   
            stringBuilder.Append(item.WhoisResponse);

            stringBuilder.Append("\n--- TDL information : ");
            stringBuilder.Append("\n : AuthCodeRequired");
            stringBuilder.Append(item.DomainName.TldDescription.AuthCodeRequired);
            stringBuilder.Append("\n : WhoIsPrivacy");
            stringBuilder.Append(item.DomainName.TldDescription.WhoIsPrivacy);
            stringBuilder.Append("\n : Available");                    
            stringBuilder.Append(item.DomainName.TldDescription.Available);
            stringBuilder.Append("\n : TldCode");                    
            stringBuilder.Append(item.DomainName.TldDescription.TldCode);
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also