Exemplo n.º 1
0
        public ResultCodeModel SaveSelfReported(LoanCanonicalType SelfReported)
        {
            _log.Info("InvokeSelfReportedService.SaveSelfReported() starting ...");
            LoanManagementClient        client      = null;
            Dictionary <string, string> paramList   = null;
            ResponseMessageList         messageList = new ResponseMessageList();

            //try/catch here, and handle results/errors appropriately...
            ResultCodeModel result = new ResultCodeModel();


            try
            {
                client            = new LoanManagementClient();
                result.ResultCode = client.SaveLoanSelfReportedEntry(paramList, ref SelfReported, out messageList);
            }
            catch (TimeoutException timeout)
            {
                ErrorModel error = new ErrorModel("There was a timeout problem calling the SelfReported Management Service", "InvokeSelfReportedMangementService");
                result.ErrorList.Add(error);
                result.ResultCode = 2;//FAIL;
                ProxyHelper.HandleServiceException(client);
                _log.Error("InvokeSelfReportedService.SaveSelfReported() Timeout Exception:" + timeout.Message);
            }
            catch (CommunicationException comm)
            {
                ErrorModel error = new ErrorModel("There was a communication problem calling the SelfReported Management Service", "InvokeSelfReportedMangementService");
                result.ErrorList.Add(error);
                result.ResultCode = 2;//FAIL;
                ProxyHelper.HandleServiceException(client);
                _log.Error("InvokeSelfReportedService.SaveSelfReported() Communication Exception:" + comm.Message);
            }
            catch (Exception e)
            {
                ErrorModel error = new ErrorModel("There was an exception thrown calling the SelfReported Management Service", "InvokeSelfReportedMangementService");
                result.ErrorList.Add(error);
                result.ResultCode = 2;//FAIL;
                _log.Error("InvokeSelfReportedService.SaveSelfReported() Exception:" + e.Message);
            }
            finally
            {
                if (client != null && client.State != CommunicationState.Closed)
                {
                    ProxyHelper.CloseChannel(client);
                }
            }


            _log.Info("InvokeSelfReportedService.SaveSelfReported() ending ...");
            return(result);
        }
Exemplo n.º 2
0
        public QASearchResult ValidateAddress(QASearch search)
        {
            _log.Info("InvokeQasService.ValidateAddress() starting ...");
            QAPortTypeClient client = null;
            QASearchResult   result = null;

            try
            {
                client = new QAPortTypeClient();
                _log.Info("InvokeQasService.ValidateAddress() client created ...");
                int retryCount = 0;
                result = client.DoSearch(search);
                if (result == null && retryCount == 0)
                {
                    // retry once
                    result = client.DoSearch(search);
                    retryCount++;
                }
                _log.Info("InvokeQasService.ValidateAddress() result was returned from service ...");
            }
            catch (TimeoutException timeout)
            {
                _log.Error("InvokeQasService.ValidateAddress() Timeout Exception:" + timeout.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (CommunicationException comm)
            {
                _log.Error("InvokeQasService.ValidateAddress() Communication Exception:" + comm.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (Exception e)
            {
                _log.Error("InvokeQasService.ValidateAddress() Exception:" + e.Message);
            }
            finally
            {
                if (client != null && client.State != CommunicationState.Closed)
                {
                    ProxyHelper.CloseChannel(client);
                }
            }

            _log.Info("InvokeQasService.ValidateAddress() ending ...");
            return(result);
        }
Exemplo n.º 3
0
        public GetLoanResponse GetLoan(GetLoanRequest getRequest)
        {
            _log.Debug("InvokeLoanManagementService.GetLoan() starting ...");
            LoanManagementClient client = null;

            GetLoanResponse response = null;

            try
            {
                client = new LoanManagementClient();
                _log.Debug("client created successfully");
                ILoanManagement lm = (ILoanManagement)client;
                response = lm.GetLoan(getRequest);
                _log.Debug("response was received from ODS LoanManagement service");
            }
            catch (TimeoutException timeout)
            {
                _log.Error("InvokeLoanManagementService.GetLoan() Timeout Exception:" + timeout.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (CommunicationException comm)
            {
                _log.Error("InvokeLoanManagementService.GetLoan() Communication Exception:" + comm.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (Exception e)
            {
                _log.Error("InvokeLoanManagementService.GetLoan() Exception:" + e.Message);
            }
            finally
            {
                if (client != null && client.State != CommunicationState.Closed)
                {
                    ProxyHelper.CloseChannel(client);
                }
            }

            _log.Debug("InvokeLoanManagementService.GetLoan() ending ...");
            return(response);
        }
Exemplo n.º 4
0
        public GetLoanSelfReportedEntryResponse GetSelfReported(GetLoanSelfReportedEntryRequest getRequest)
        {
            _log.Info("InvokeSelfReportedService.GetSelfReported() starting ...");
            LoanManagementClient             client   = null;
            GetLoanSelfReportedEntryResponse response = null;


            try
            {
                client = new LoanManagementClient();
                ILoanManagement lm = (ILoanManagement)client;
                response = lm.GetLoanSelfReportedEntry(getRequest);
            }
            catch (TimeoutException timeout)
            {
                _log.Error("InvokeSelfReportedService.GetSelfReported() Timeout Exception:" + timeout.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (CommunicationException comm)
            {
                _log.Error("InvokeSelfReportedService.GetSelfReported() Communication Exception:" + comm.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (Exception e)
            {
                _log.Error("InvokeSelfReportedService.GetSelfReported() Exception:" + e.Message);
            }
            finally
            {
                if (client != null && client.State != CommunicationState.Closed)
                {
                    ProxyHelper.CloseChannel(client);
                }
            }


            _log.Info("InvokeSelfReportedService.GetSelfReported() ending ...");
            return(response);
        }
Exemplo n.º 5
0
        public GetAppToolResponse GetAppTool(GetAppToolRequest getRequest)
        {
            _log.Info("InvokeAppToolService.GetAppTool() starting ...");
            AppToolClient      client   = null;
            GetAppToolResponse response = null;

            try
            {
                client = new AppToolClient();
                IAppTool pm = (IAppTool)client;
                response = pm.GetAppTool(getRequest);
            }
            catch (TimeoutException timeout)
            {
                _log.Error("InvokeAppToolService.GetAppTool() Timeout Exception:" + timeout.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (CommunicationException comm)
            {
                _log.Error("InvokeAppToolService.GetAppTool() Communication Exception:" + comm.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (Exception e)
            {
                _log.Error("InvokeAppToolService.GetAppTool() Exception:" + e.Message);
            }
            finally
            {
                if (client != null && client.State != CommunicationState.Closed)
                {
                    ProxyHelper.CloseChannel(client);
                }
            }


            _log.Info("InvokeAppToolService.GetAppTool() ending ...");
            return(response);
        }