2.5 Purchase a domain

By using the Aruba WsDomains method SetPurchaseCloudDomain is possible to request a domain name registration, collecting following data: tld, domain name, domain contact data and authoritative DNS data.

Parameters
domainFullName
Type: String
Full name of the domain.

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

dnsEntyties
Type: DnsHostEntity
Array of DnsHostEntity object with hostname and ip address of each dns entry.

autoRenew
Type: bool
Set the auto-reniew option .

domainPrivacy
Type: bool
Set the domainPrivacy option .

firstName
Type: String
First Name of Registrant .

firstName
Type: String
First Name of Registrant .

lastName
Type: String
Last Name of Registrant .

addressField1
Type: String
Address of Registrant .

addressField2
Type: String
2th Address of Registrant .

addressField3
Type: String
3th Address of Registrant .

city
Type: String
City of Registrant .

country
Type: String
Country of Registrant .

email
Type: String
Email of Registrant .

fax
Type: String
Fax number of Registrant .

organizationName
Type: String
Organization Name of Registrant .

phone
Type: String
Phone number of Registrant .

state
Type: String
State of Registrant .

tldData
Type: String
TldData information.


    /// WsDomains.SetPurchaseCloudDomain Method (c# .NET)
    public static string SetPurchaseCloudDomain(WsDomainsClient client,
        String domainFullName, PreferredLanguages preferredLanguage,
        DnsHostEntity[] dnsEntyties, bool autoRenew, bool domainPrivacy,
        String firstName, String lastName, 
        String addressField1, String addressField2, String addressField3, 
        String city, String country, String email, String fax, 
        String organizationName, String phone, String postalCode,
        String state, String tldData)
    {
        //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
            SetPurchaseCloudDomainRequest request = 
                new SetPurchaseCloudDomainRequest();

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

            request.Body.DomainData = new DomainDataEntity();
            request.Body.DomainData.AutoRenew = autoRenew;
            request.Body.DomainData.DomainPrivacy = domainPrivacy;
            request.Body.DomainData.AuthoritativeDns = dnsEntyties;              
                
            // set registrant data
            request.Body.DomainData.Registrant =  new DomainRegistrantEntity();
            request.Body.DomainData.Registrant.FirstName = firstName;
            request.Body.DomainData.Registrant.LastName = lastName;
            request.Body.DomainData.Registrant.AddressField1 = addressField1;
            request.Body.DomainData.Registrant.AddressField2 = addressField2;
            request.Body.DomainData.Registrant.AddressField3 = addressField3;
            request.Body.DomainData.Registrant.City= city;
            request.Body.DomainData.Registrant.Country =  country;
            request.Body.DomainData.Registrant.Email = email;
            request.Body.DomainData.Registrant.Fax = fax;
            request.Body.DomainData.Registrant.OrganizationName = organizationName;
            request.Body.DomainData.Registrant.Phone = phone;
            request.Body.DomainData.Registrant.PostalCode = postalCode;
            request.Body.DomainData.Registrant.State = state;
            request.Body.DomainData.Registrant.TldData = tldData;

            // call method SetPurchaseCloudDomain 
            // obtaining a WsResult item
            WsResult result = client.SetPurchaseCloudDomain(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.SetPurchaseCloudDomain Method (JAVA)
public static String SetPurchaseCloudDomain(IWsDomains client,
        String domainFullName, PreferredLanguages preferredLanguage,
        ArrayOfDnsHostEntity dnsEntyties, boolean autoRenew, boolean domainPrivacy,
        String firstName, String lastName,
        String addressField1, String addressField2, String addressField3,
        String city, String country, String email, String fax,
        String organizationName, String phone, String postalCode,
        String state, String tldData) 
    {
    //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
        SetPurchaseCloudDomainRequest request = new SetPurchaseCloudDomainRequest();
        request.setBody(new FullDomainDataEntity());
        request.getBody().setDomainName(new InputDomainNameEntity());
        request.getBody().getDomainName().setDomainFullName(domainFullName);
        request.getBody().getDomainName().setPreferredLanguage(preferredLanguage);

        request.getBody().setDomainData(new DomainDataEntity());
        request.getBody().getDomainData().setAutoRenew(autoRenew);
        request.getBody().getDomainData().setDomainPrivacy(domainPrivacy);
        request.getBody().getDomainData().setAuthoritativeDns(dnsEntyties);

        // set registrant data
        request.getBody().getDomainData().setRegistrant(new DomainRegistrantEntity());
        DomainRegistrantEntity domainRegistrantEntity = 
            request.getBody().getDomainData().getRegistrant();
        domainRegistrantEntity.setFirstName(firstName);
        domainRegistrantEntity.setLastName(lastName);
        domainRegistrantEntity.setAddressField1(addressField1);
        domainRegistrantEntity.setAddressField2(addressField2);
        domainRegistrantEntity.setAddressField3(addressField3);
        domainRegistrantEntity.setCity(city);
        domainRegistrantEntity.setCountry(country);
        domainRegistrantEntity.setEmail(email);
        domainRegistrantEntity.setFax(fax);
        domainRegistrantEntity.setOrganizationName(organizationName);
        domainRegistrantEntity.setPhone(phone);
        domainRegistrantEntity.setPostalCode(postalCode);
        domainRegistrantEntity.setState(state);
        domainRegistrantEntity.setTldData(tldData);

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