Domains and DNS > 3 - Advanced Domains Management > Activate the Whois Privacy service

3.1 Activate the Whois Privacy service

By using the Aruba WsDomains method SetActivateDomainPrivacy is possible to purchase the activation of Privacy on data returned by public Whoisservces on a Domain. Whois privacy validity ends at domain expiry date. If a valid payment is available, this method only enable data darkening .

Parameters
domainFullName
Type: String
Full name of the domain.


    /// WsDomains.SetActivateDomainPrivacy Method (c# .NET)
    public static string SetActivateDomainPrivacy(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
            SetChangeDomainPrivacyRequest request = 
                new SetChangeDomainPrivacyRequest();

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

            // call method SetActivateDomainPrivacy 
            // obtaining a WsResult item
            WsResult result = client.SetActivateDomainPrivacy(request);

            //if the call is Success print history values
            if (result.Success)
            {
                // get Value returned from server
                stringBuilder.Append("Operation ends successfully. Result Code:");
                stringBuilder.Append(result.ResultCode);
            }
            else
            {
                throw new ApplicationException(result.ResultMessage);
            }
        }
        catch (Exception ex)
        {
            // re-run the error
            throw new ApplicationException(ex.Message);
        }

        return stringBuilder.ToString();
    }
    
/// WsDomains.SetActivateDomainPrivacy Method (JAVA)
public static String SetActivateDomainPrivacy(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
        SetChangeDomainPrivacyRequest request 
            = new SetChangeDomainPrivacyRequest();
        request.setBody(new InputDomainNameEntity());
        request.getBody().setDomainFullName(domainFullName);

        // call method SetActivateDomainPrivacy 
        // obtaining a WsResult item
        WsResult result = client.setActivateDomainPrivacy(request);

        //if the call is Success print history values
        if (result.isSuccess()) {
            // get Value returned from server
            stringBuilder.append("Operation ends successfully. Result Code : ");
            stringBuilder.append(result.getResultCode());
        } 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