Click or drag to resize

IWsCommonGetUserOtp Method

Returns information associated to the provided username.

Namespace:  Aruba.Cloud.WsCommon
Assembly:  Aruba.Cloud.WsCommon (in Aruba.Cloud.WsCommon.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<UserDataOtp> GetUserOtp()

Return Value

Type: WsResultUserDataOtp
Examples
/// IWsCommon.GetUserOtp  Method (c# .NET)
public static string GetUserOtp(WsCommonClient client)
{
//specify the account login details
client.ClientCredentials.UserName.UserName = "ARU-0000";
client.ClientCredentials.UserName.Password = "0123456789";

StringBuilder stringBuilder = new StringBuilder();

try
{
// call method GetUserOtp
// obtaining a WsResultOfUserDataOtp item
WsResultOfUserDataOtp result = client.GetUserOtp();

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

// get Value returned from server
UserDataOtp item = result.Value;

if (item != null)
{
stringBuilder.Append("UserDataOtp detail\n");

stringBuilder.Append("\nId: ");
stringBuilder.Append(item.Id);
stringBuilder.Append("\nDomain: ");
stringBuilder.Append(item.Domain);
stringBuilder.Append("\nActivationCode: ");
stringBuilder.Append(item.ActivationCode);
}
}
else
{
throw new ApplicationException(result.ResultMessage);
}
}
catch (Exception ex)
{
// re-run the error
throw new ApplicationException(ex.Message);
}

return stringBuilder.ToString();
}
See Also