/// <summary> /// method usage of the web service method RetrievePanelOfReporters /// Clients should call this method to obtain a list of all financial institutions who filed Call Report /// for a particular reporting period. This method should typically be called once or infrequently to obtain /// the complete list of banks in the PoR. Subsequently, the web clients should call RetrieveFilersSinceDate /// to find out the list of banks that have filed their original or amended Call Reports. async public void LoadReportingInstitutions(FilingProcessCommandArgs commandLineArgs) { FFIECPublicWebService.ReportingDataSeriesName dsName = FFIECPublicWebService.ReportingDataSeriesName.Call; FFIECPublicWebService.RetrievalService proxy = new FFIECPublicWebService.RetrievalService(); UsernameToken userToken = new UsernameToken(commandLineArgs.Credentials.UserName, commandLineArgs.Credentials.Password, PasswordOption.SendHashed); proxy.RequestSoapContext.Security.Tokens.Add(userToken); proxy.Timeout = 400000; FFIECPublicWebService.ReportingFinancialInstitution[] reporters = proxy.RetrievePanelOfReporters(dsName, commandLineArgs.ReportingCycleEndDate); Console.WriteLine("OK" + "Retrieved panel of reporters. "); foreach (FFIECPublicWebService.ReportingFinancialInstitution reporter in reporters) { Console.WriteLine("Adding " + reporter.Name.Trim() + "|" + reporter.ID_RSSD + "|" + reporter.State + "|" + reporter.HasFiledForReportingPeriod); var reportingInstitution = await ReportingInstitutionTable.Where(riItem => riItem.ID_RSSD == reporter.ID_RSSD).ToListAsync(); if (reportingInstitution.Count == 0) { CallReporter.Model.ReportingFinancialInstitution newInstitution = new CallReporter.Model.ReportingFinancialInstitution(); // ToDo: Put assignment in its own method, create assignment operators newInstitution.Address = reporter.Address; newInstitution.City = reporter.City; newInstitution.FDICCertNumber = reporter.FDICCertNumber; newInstitution.FilingType = reporter.FilingType; newInstitution.HasFiledForReportingPeriod = reporter.HasFiledForReportingPeriod; newInstitution.ID_RSSD = reporter.ID_RSSD; newInstitution.Name = reporter.Name; newInstitution.OCCChartNumber = reporter.OCCChartNumber; newInstitution.OTSDockNumber = reporter.OTSDockNumber; newInstitution.PrimaryABARoutNumber = reporter.PrimaryABARoutNumber; newInstitution.State = reporter.State; newInstitution.ZIP = reporter.ZIP; await ReportingInstitutionTable.InsertAsync(newInstitution); } else { await UpdateAsync(ReportingInstitutionTable, reportingInstitution[0], reporter); } } Console.WriteLine("OK" + "Total members of POR = " + reporters.Length.ToString()); }
/// <summary> /// method usage of the web service helper method RetrieveReportingPeriods /// Clients should call this method to obtain a list of available reporting periods in the correct format /// to call the other retrieval methods /// </summary> public static void RetrieveReportingPeriods(Credentials creds) { string UserID = creds.UserName; string UserSecurityToken = creds.Password; FFIECPublicWebService.ReportingDataSeriesName dsName = FFIECPublicWebService.ReportingDataSeriesName.Call; FFIECPublicWebService.RetrievalService proxy = new FFIECPublicWebService.RetrievalService(); UsernameToken userToken = new UsernameToken(UserID, UserSecurityToken, PasswordOption.SendHashed); proxy.RequestSoapContext.Security.Tokens.Add(userToken); string[] reportingPeriodEndList = proxy.RetrieveReportingPeriods(dsName); foreach (var item in reportingPeriodEndList) { Console.WriteLine(item.ToString()); } Console.WriteLine("OK, " + String.Format("Retrieved available reporting periods for {0}.", dsName)); }