Пример #1
0
        public void run(PerSecurityWS ps)
        {
            try
            {
                //Setting getCorrections request and response objects
                GetCorrectionsRequest getCorrReq = new GetCorrectionsRequest();
                 GetCorrectionsResponse getCorrResp = new GetCorrectionsResponse();
                 Console.WriteLine("Sending get corrections request");
                do
                {
                    //Polling for response till its available
                    System.Threading.Thread.Sleep(PerSecurity.POLL_INTERVAL);
                    getCorrResp = ps.getCorrections(getCorrReq);
                } while (getCorrResp.statusCode.code == PerSecurity.DATA_NOT_AVAILABLE);

                //Displaying output
                if (getCorrResp.statusCode.code == PerSecurity.SUCCESS)
                {
                    Console.WriteLine("Retrieve get data request successful");
                    Console.WriteLine("Following are the corrections:\n");
                    for (int i = 0; i < getCorrResp.correctionRecords.Length; i++)
                    {
                        Console.WriteLine("\tInstrument: " + getCorrResp.correctionRecords[i].instrument.id + " " + getCorrResp.correctionRecords[i].instrument.yellowkey + "\n"
                            + "\tFields: " + getCorrResp.correctionRecords[i].field + "\n" +
                            "\tOld Value: " + getCorrResp.correctionRecords[i].oldValue.ToString() + "\n" +
                            "\tNew Value: " + getCorrResp.correctionRecords[i].newValue.ToString());

                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);

            }
        }