Domains and DNS > 2 - Domains Management > Check if a domain is transferable

2.6 Check if a domain is transferable

By using the Aruba WsDomains method GetIsTransferableDomain is possible to check if a domain name is tranferable.

Parameters
domainFullName
Type: String
Full name of the domain.

preferredLanguage
Type: PreferredLanguages
Enum with the value of preferred language.


    /// WsDomains.GetIsTransferableDomain Method (c# .NET)
    public static string GetIsTransferableDomain(WsDomainsClient client,
        String domainFullName, PreferredLanguages preferredLanguage)
    {
        //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 
            GetIsTransferableDomainRequest request = 
                new GetIsTransferableDomainRequest();

            request.Body = new InputDomainNameEntity();
            request.Body.DomainFullName = domainFullName;
            request.Body.PreferredLanguage = preferredLanguage;

            // call method GetIsTransferableDomain 
            // obtaining a WsResultOfDomainTransferableEntity item
            WsResultOfDomainTransferableEntity result = 
                client.GetIsTransferableDomain(request);

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

                DomainTransferableEntity item = result.Value;
                stringBuilder.Append("\nDomainFullName : ");
                stringBuilder.Append(item.DomainName.DomainFullName);
                stringBuilder.Append("\nPreferredLanguage : ");
                stringBuilder.Append(item.DomainName.PreferredLanguage);
                stringBuilder.Append("\nIsTransferable : ");
                stringBuilder.Append(item.IsTransferable);

                if (item.TransferabilityResults.HasValue)
                {
                    stringBuilder.Append("\nTransferabilityResults : ");
                    stringBuilder.Append(item.TransferabilityResults.Value);
                }
            }
            else
            {
                throw new ApplicationException(result.ResultMessage);
            }
        }
        catch (Exception ex)
        {
            // re-run the error
            throw new ApplicationException(ex.Message);
        }

        return stringBuilder.ToString();
    }
    
/// WsDomains.GetIsTransferableDomain Method (JAVA)
public static String GetIsTransferableDomain(IWsDomains client,
        String domainFullName, PreferredLanguages preferredLanguage) 
    {
    //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 
        GetIsTransferableDomainRequest request = 
            new GetIsTransferableDomainRequest();
        request.setBody(new InputDomainNameEntity());
        request.getBody().setDomainFullName(domainFullName);
        request.getBody().setPreferredLanguage(preferredLanguage);

        // call method GetIsTransferableDomain 
        // obtaining a WsResultOfDomainTransferableEntity item
        WsResultOfDomainTransferableEntity result = 
            client.getIsTransferableDomain(request);

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

            DomainTransferableEntity item = result.getValue();
            stringBuilder.append("\nDomainFullName : ");
            stringBuilder.append(item.getDomainName().getDomainFullName());
            stringBuilder.append("\nPreferredLanguage : ");
            stringBuilder.append(item.getDomainName().getPreferredLanguage());
            stringBuilder.append("\nIsTransferable : ");
            stringBuilder.append(item.isIsTransferable());
        } 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
See also