public static IChangePassPhraseResponse ChangePassPhrase(IChangePassPhraseRequest request, ILogger logger = null) { string message; IChangePassPhraseResponse changePassPhraseResponse; try { EwsLabelService client = new EwsLabelService(); changePassPhraseResponse = ChangePassPhraseClass.ConstructAccountStatusResponse(client.ChangePassPhrase(ChangePassPhraseClass.ConstructChangePassRequest(request))); } catch (BadRequestException badRequestException) { message = string.Format("Endicia::Invoker::ChangePassPhrase Failed({0}).", badRequestException.Message); Logger.ExternalLogDebug(logger, message); throw; } catch (Exception exception) { Exception ex = exception; message = string.Format("Endicia::Invoker::ChangePassPhrase Failed({0}).", ex.Message); Logger.ExternalLogDebug(logger, message); throw new Exception(message, ex); } return(changePassPhraseResponse); }
internal static ChangePassPhraseRequest ConstructChangePassRequest(IChangePassPhraseRequest request) { ChangePassPhraseRequest result = new ChangePassPhraseRequest() { RequesterID = ToolsClass.GetRequesterID, RequestID = ToolsClass.GetRequestID, NewPassPhrase = request.NewPassPhrase, CertifiedIntermediary = new CertifiedIntermediary() { AccountID = request.AccountID, PassPhrase = request.CurrentPassPhrase } }; Logger.InternalLogDebug(string.Format("ChangePassPhraseClass::ConstructChangePassRequest -> AccountID {0} RequestGuid {1} RequesterID {2} ", result.CertifiedIntermediary.AccountID, result.RequestID, result.RequesterID)); return(result); }