예제 #1
0
            public void run(PerSecurityWS ps)
            {

            try{
                String responseId = "dummy-response-id";
	        GetPortfolioValidationRequest req = new GetPortfolioValidationRequest();
	        req.responseId = responseId;
			Console.WriteLine("Sending submit portfolio validation request");
	        GetPortfolioValidationResponse resp = ps.getPortfolioValidation(req);

            int count = 0;
			// Keep polling for response till the data is available
			do
			{
				Console.WriteLine("This is a dummy response id. The data is not available");
                System.Threading.Thread.Sleep(PerSecurity.POLL_INTERVAL);
				resp = ps.getPortfolioValidation(req);
				count++;
			} while (resp.statusCode.code == PerSecurity.DATA_NOT_AVAILABLE && count < 5);
                	// Display data
			if (resp.statusCode.code == PerSecurity.SUCCESS)
			{
				Console.WriteLine("Retrieve get quotes request successful.  Response ID:" + resp.responseId);
				for (int i = 0; i < resp.instrumentDatas.Length; i++)
				{
					Console.WriteLine("Data for :"
                            + resp.instrumentDatas[i].instrument.id + " "
                            + resp.instrumentDatas[i].instrument.yellowkey);

					Console.WriteLine("validation code =  "
                            + resp.instrumentDatas[i].code.ToString());
							//+ ", bb unique =  "
							//+ resp.instrumentDatas[i].bbUnique);
				}
			}
			else if (resp.statusCode.code == PerSecurity.REQUEST_ERROR)
                Console.WriteLine("Error in submitted request");

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