Domains and DNS > 3 - Advanced Domains Management > Lock and Unlock the Domain Transfer Status

3.2 Lock and Unlock the Domain Transfer Status

By using the Aruba WsDomains method SetDomainLockStatus is possible to enable the block of domain transfer.

Parameters
domainFullName
Type: String
Full name of the domain.

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

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

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

            //if the call is Success print history values
            if (result.Success)
            {
                // get Value returned from server
                stringBuilder.Append("Operation 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.SetDomainLockStatus and WsDomains.SetDomainUnlockStatus Method (JAVA)
public static String SetDomainLockStatus(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
        SetDomainLockStatusRequest request = new SetDomainLockStatusRequest();
        request.setBody(new InputDomainNameEntity());
        request.getBody().setDomainFullName(domainFullName);

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

        //if the call is Success print history values
        if (result.isSuccess()) {
            // get Value returned from server
            stringBuilder.append(" Operation 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();
}
By using the Aruba WsDomains method SetDomainUnlockStatus is possible to enable the unblock of domain transfer.

Parameters
domainFullName
Type: String
Full name of the domain.

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

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

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

            //if the call is Success print history values
            if (result.Success)
            {
                // get Value returned from server
                stringBuilder.Append("Operation 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.SetDomainUnlockStatus Method (JAVA)
public static String SetDomainUnlockStatus(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
        SetDomainLockStatusRequest request = new SetDomainLockStatusRequest();
        request.setBody(new InputDomainNameEntity());
        request.getBody().setDomainFullName(domainFullName);

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

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