コード例 #1
0
 public ArrayOfString Call(double amount, int duration, int creditScore)
 {
     //initializes and envokes the methode of the webservice
     proxy      = new RuleBaseServiceSoapClient();
     BankQueues = proxy.GetBankQueues(amount, duration, creditScore);
     return(BankQueues);
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: tdkryger/SystemIntegration
        public static void Main(string[] args)
        {
            Console.Title = "2 - RuleBase Fetcher";
            Console.SetWindowSize(80, 5);
            Console.WriteLine("<--Listening for messages on queue: " + Queues.CREDITBUREAU_OUT);
            HandleMessaging.RecieveMessage(Queues.CREDITBUREAU_OUT, (object model, BasicDeliverEventArgs ea) =>
            {
                Console.WriteLine("<--Message recieved on queue: " + Queues.CREDITBUREAU_OUT);

                LoanRequest loanRequest;

                loanRequest = JsonConvert.DeserializeObject <LoanRequest>(Encoding.UTF8.GetString(ea.Body));

                Console.WriteLine("<--Message content:");
                Console.WriteLine("<--" + loanRequest);

                RuleBaseServiceSoapClient service;
                ArrayOfString strings;

                service           = new RuleBaseServiceSoapClient();
                loanRequest.Banks = new List <Bank>();
                strings           = service.GetBanks();

                foreach (string jSonRepOfBank in strings)
                {
                    Bank bank;
                    bank = JsonConvert.DeserializeObject <Bank>(jSonRepOfBank);

                    if (loanRequest.CreditScore >= bank.MinCreditScore &&
                        loanRequest.CreditScore <= bank.MaxCreditScore &&
                        loanRequest.Amount >= bank.MinAmount &&
                        loanRequest.Amount <= bank.MaxAmount &&
                        loanRequest.Duration >= bank.MinDuration &&
                        loanRequest.Duration <= bank.MaxDuration)
                    {
                        loanRequest.Banks.Add(bank);
                    }
                }

                Console.WriteLine("<--Enriched message content:");
                Console.WriteLine("<--" + loanRequest);

                Console.WriteLine("<--Sending message on queue: " + Queues.BANKFETCHER_OUT);
                Console.WriteLine();
                HandleMessaging.SendMessage <LoanRequest>(Queues.BANKFETCHER_OUT, loanRequest);
            });
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: tdkryger/SystemIntegration
        public static void Main(string[] args)
        {
            Console.Title = "2 - RuleBase Fetcher";
            Console.SetWindowSize(80, 5);
            Console.WriteLine("<--Listening for messages on queue: " + Queues.CREDITBUREAU_OUT);
            HandleMessaging.RecieveMessage(Queues.CREDITBUREAU_OUT, (object model, BasicDeliverEventArgs ea) =>
            {
                Console.WriteLine("<--Message recieved on queue: " + Queues.CREDITBUREAU_OUT);

                LoanRequest loanRequest;

                loanRequest = JsonConvert.DeserializeObject<LoanRequest>(Encoding.UTF8.GetString(ea.Body));

                Console.WriteLine("<--Message content:");
                Console.WriteLine("<--" + loanRequest);

                RuleBaseServiceSoapClient service;
                ArrayOfString strings;

                service = new RuleBaseServiceSoapClient();
                loanRequest.Banks = new List<Bank>();
                strings = service.GetBanks();

                foreach (string jSonRepOfBank in strings)
                {
                    Bank bank;
                    bank = JsonConvert.DeserializeObject<Bank>(jSonRepOfBank);

                    if (loanRequest.CreditScore >= bank.MinCreditScore &&
                        loanRequest.CreditScore <= bank.MaxCreditScore &&
                        loanRequest.Amount >= bank.MinAmount &&
                        loanRequest.Amount <= bank.MaxAmount &&
                        loanRequest.Duration >= bank.MinDuration &&
                        loanRequest.Duration <= bank.MaxDuration)
                    {
                        loanRequest.Banks.Add(bank);
                    }
                }

                Console.WriteLine("<--Enriched message content:");
                Console.WriteLine("<--" + loanRequest);

                Console.WriteLine("<--Sending message on queue: " + Queues.BANKFETCHER_OUT);
                Console.WriteLine();
                HandleMessaging.SendMessage<LoanRequest>(Queues.BANKFETCHER_OUT, loanRequest);
            });
        }