3.8 Call whois service

By using the Aruba WsDomains method GetDomainWhois is possible to make a public whoiscall using a domain name .

Parameters
domainFullName
Type: String
Full name of the domain.

    /// 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();
    }
    
/// WsDomains.GetDomainWhois Method (JAVA)
public static String GetDomainWhois(IWsDomains client,
        String domainFullName) 
    {
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

    StringBuilder stringBuilder = new StringBuilder();

    try {
        // create the request object 
        GetDomainWhoisRequest request = new GetDomainWhoisRequest();
        request.setBody(new InputDomainNameEntity());
        request.getBody().setDomainFullName(domainFullName);

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

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

            stringBuilder.append("\nDomainFullName : ");
            stringBuilder.append(item.getDomainName().getDomainFullName());
            stringBuilder.append("\nWhoisResponse : ");
            stringBuilder.append(item.getWhoisResponse());

            stringBuilder.append("\n--- TDL information : ");
            stringBuilder.append("\n : AuthCodeRequired");
            stringBuilder.append(item.getDomainName().getTldDescription().getAuthCodeRequired());
            stringBuilder.append("\n : WhoIsPrivacy");
            stringBuilder.append(item.getDomainName().getTldDescription().getWhoIsPrivacy());
            stringBuilder.append("\n : Available");                    
            stringBuilder.append(item.getDomainName().getTldDescription().getAvailable());
            stringBuilder.append("\n : TldCode");                    
            stringBuilder.append(item.getDomainName().getTldDescription().getTldCode());

        } else {
            throw new Exception(result.getResultMessage());
        }
    } catch (Exception ex) {
        //show error
        System.out.println(ex);
    }

    return stringBuilder.toString();
}
    /// 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);

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

        return stringBuilder.ToString();
    }
    
/// WsDomains.GetDomainWhois Method (JAVA)
public static String GetDomainWhois(IWsDomains client,
        String domainFullName) 
    {
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

    StringBuilder stringBuilder = new StringBuilder();

    try {
        // create the request object 
        GetDomainWhoisRequest request = new GetDomainWhoisRequest();
        request.setBody(new InputDomainNameEntity());
        request.getBody().setDomainFullName(domainFullName);

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

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

            stringBuilder.append("\nDomainFullName : ");
            stringBuilder.append(item.getDomainName().getDomainFullName());
            stringBuilder.append("\nWhoisResponse : ");
            stringBuilder.append(item.getWhoisResponse());

        } else {
            throw new Exception(result.getResultMessage());
        }
    } catch (Exception ex) {
        //show error
        System.out.println(ex);
    }

    return stringBuilder.toString();
}
Version
API: v2.8 URL:https://api.services.cloud.it/wsDomains/v2.8/WsDomains.svc?wsdl