public AddAccountPartyRelationship GetAddAccountPartyRelationship() { var accountPartyRelationship = new AddAccountPartyRelationship() { Message = new Dto.Soap.Message() { DataUpdate = new DataUpdate() { TraceNumber = "1266523457", ProcessingCode = "ExternalUpdateRequest", Source = "LoanOrigination", UpdateAction = "Indeterminate", AccountPartyRelationships = new List <AccountPartyRelationship>() { new AccountPartyRelationship() { UpdateAction = "Add", AccountNumber = "9000000008000", PartyNumber = "5597", PartyType = "Person", AccountRelationshipType = "CoMaker", OriginationDate = "2007-02-10" } } } } }; return(accountPartyRelationship); }
public AddAccountPartyRelationship GetDto(Applicant applicant) { var accountPartyRelationship = new AddAccountPartyRelationship() { Message = GetMessage(applicant) }; return(accountPartyRelationship); }
public BaseResult AddAccountPartyRelationship(Applicant applicant) { var result = new BaseResult(); using (var tr = new Tracer("LMS.Connector.CCM.Behaviors.Soap.AddAccountPartyRelationshipBehavior.AddAccountPartyRelationship")) { tr.Log($"AddAccountPartyRelationship for ApplicantId {applicant.ApplicantId}, PersonNumber => {applicant.PersonNumber}"); tr.Log($"AddAccountPartyRelationship _accountPartyRelationship null? => {_accountPartyRelationship == null}"); if (_accountPartyRelationship == null) { tr.Log("Call GetDto() to get new _accountPartyRelationship"); _accountPartyRelationship = GetDto(applicant); } tr.LogObject(_accountPartyRelationship); try { tr.Log("Calling ISoapRepository.AddAccountPartyRelationship"); _messageResponse = _soapRepository.AddAccountPartyRelationship(_accountPartyRelationship, _app, applicant); tr.Log($"_messageResponse.ResponseCode = {_messageResponse?.ResponseCode}"); tr.Log($"_messageResponse.ErrorMessage = {_messageResponse?.ErrorMessage}"); } catch (Exception ex) { tr.LogException(ex); result.Result = false; result.ExceptionId = Utility.LogError(ex, "LMS.Connector.CCM.Behaviors.Soap.AddAccountPartyRelationshipBehavior.AddAccountPartyRelationship"); result.AddMessage(MessageType.Error, $"Exception when attempting to call SOAP Repository AddAccountPartyRelationship(): {ex.Message}"); } finally { // Deallocate DTO _accountPartyRelationship = null; } if (_messageResponse?.ResponseCode != "Success" && _messageResponse?.ErrorMessage?.Length > 0) { result.Result = false; result.AddMessage(MessageType.Warning, _messageResponse.ErrorMessage); } } return(result); }
public MessageResponse AddAccountPartyRelationship(AddAccountPartyRelationship accountPartyRelationship, Application app, Applicant applicant) { MessageResponse messageResponse = null; string messageXml = string.Empty; using (var tr = new Tracer("LMS.Connector.CCM.Repositories.SoapRepository.AddAccountPartyRelationship")) { try { messageXml = accountPartyRelationship.Message?.SerializeToXmlString(); tr.Log($"AddAccountPartyRelationship: BEFORE setting host values => {messageXml}"); tr.Log("AddAccountPartyRelationship: Set Application-level host values"); messageXml = HostValueTranslator.UpdateRequestWithHostValues( messageXml, app.HostValues.Where(hv => hv.Field1.StartsWith("AddAccountPartyRelationship.")).ToList(), accountPartyRelationship.Message?.HostValueParentNode ); tr.Log($"AddAccountPartyRelationship: AFTER Application-level host values => {messageXml}"); tr.Log("AddAccountPartyRelationship: Set Applicant-level host values"); messageXml = HostValueTranslator.UpdateRequestWithHostValues( messageXml, applicant.HostValues.Where(hv => hv.Field1.StartsWith("AddAccountPartyRelationship.")).ToList(), accountPartyRelationship.Message?.HostValueParentNode ); tr.Log($"AddAccountPartyRelationship: AFTER Applicant-level host values => {messageXml}"); tr.LogObject(CredentialsHeader); tr.Log("AddAccountPartyRelationship: Calling ISoapRepository.ProcessMessage"); messageResponse = ProcessMessage(messageXml); } catch (Exception ex) { // Handle serialization and host value translation exceptions here tr.LogException(ex); Utility.LogError(ex, "LMS.Connector.CCM.Repositories.SoapRepository.AddAccountPartyRelationship"); throw; } } return(messageResponse); }
public void SetUp() { _accountPartyRelationship = GetAddAccountPartyRelationship(); _app = GetApplication(); _userToken = "aBc123"; }
public void TearDown() { _accountPartyRelationship = null; _app = null; }