3.6 Change the domain owner

By using the Aruba WsDomains method SetChangeDomainOwner is possible to change data of a domain owner.If original First name, last name, OrgName are changed metthod will perform a change domain ownership operation.

Parameters
strong>domainFullName
Type: String
Full name of the domain.

registrant
Type: DomainRegistrantEntity
Object which contains all data about of Registrant (First name, Last name, address, city, state, country, email, fax, phone, organization name) .



    /// WsDomains.SetChangeDomainOwner Method (c# .NET)
    public static string SetChangeDomainOwner(WsDomainsClient client,
        String domainFullName, DomainRegistrantEntity registrant)
    {
        //specify the account login details 
        client.ClientCredentials.UserName.UserName = "ARU-0000";
        client.ClientCredentials.UserName.Password = "0123456789";

        StringBuilder stringBuilder = new StringBuilder();

        try
        {
            // create request object
            SetChangeDomainOwnerRequest request = 
                new SetChangeDomainOwnerRequest();

            request.Body = new NewDomainRegistrantEntity();
            request.Body.DomainName = new InputDomainNameEntity();
            request.Body.DomainName.DomainFullName = domainFullName;
            request.Body.Registrant = registrant;

            // call method SetChangeDomainOwner 
            // obtaining a WsResult item
            WsResult result = client.SetChangeDomainOwner(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.SetChangeDomainOwner Method (JAVA)
public static String SetChangeDomainOwner(IWsDomains client,
        String domainFullName, DomainRegistrantEntity registrant) 
    {
    //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 request object
        SetChangeDomainOwnerRequest request = new SetChangeDomainOwnerRequest();
        request.setBody(new NewDomainRegistrantEntity());
        request.getBody().setDomainName(new InputDomainNameEntity());
        request.getBody().getDomainName().setDomainFullName(domainFullName);
        request.getBody().setRegistrant(registrant);

        // call method SetChangeDomainOwner 
        // obtaining a WsResult item
        WsResult result = client.setChangeDomainOwner(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