IWsCommonGetUserOtp Method |
Namespace: Aruba.Cloud.WsCommon
/// 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(); }