Click or drag to resize

IWsDomainsSetActivateDomainPrivacy Method

This method purchases 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.

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 SetActivateDomainPrivacy(
	SetChangeDomainPrivacyRequest request
)

Parameters

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

Return Value

Type: WsResult
Examples
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.
/// 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();
}
See Also