Click or drag to resize

IWsDomainsGetDomainAuthInfo Method

This method retrieves domain authorization code. This code I needed for domain transfer requests.

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<DomainAuthCodeEntity> GetDomainAuthInfo(
	GetDomainAuthInfoRequest request
)

Parameters

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

Return Value

Type: WsResultDomainAuthCodeEntity
Examples
By using the Aruba WsDomains method GetDomainAuthInfo is possible to retrieve domain authorization code . This code I needed for domain transfer requests.
/// WsDomains.GetDomainAuthInfo Method (c# .NET)
public static string GetDomainAuthInfo(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
        GetDomainAuthInfoRequest request = 
            new GetDomainAuthInfoRequest();

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

        // call method GetDomainAuthInfo 
        // obtaining a WsResultOfDomainAuthCodeEntity item
        WsResultOfDomainAuthCodeEntity result = 
            client.GetDomainAuthInfo(request);

        //if the call is Success print history values
        if (result.Success)
        {
            // get Value returned from server
            stringBuilder.Append("Operation ends successfully\n");

            DomainAuthCodeEntity item = result.Value;
            stringBuilder.Append("\nDomainAuthCode: ");
            stringBuilder.Append(item.DomainAuthCode);
            stringBuilder.Append("\nDomainID: ");
            stringBuilder.Append(item.DomainID);
            stringBuilder.Append("\nDomainName: ");
            stringBuilder.Append(item.DomainName.DomainFullName);
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also