public Service_DV_1_0_orig() { //log4net.Util.LogLog.InternalDebugging = true; //log.Info("Starting " + "NWISDV"); // ODws = new WofService(this.Context);//INFO we can extend this for other service types //ODws = new GetDataInformationDailyDB(); ODws = new GetDataInformationDB(); ODws.VariableVocabulary = "NWISDV"; ODws.SiteVocabulary = "NWISDV"; QueryLoggger = new Logging(ODws.SiteVocabulary); // configure ConnectionStringSettings oddb = ConfigurationManager.ConnectionStrings["ODDB"]; ODws.DataInfoConnection = oddb.ConnectionString; ODws.VariablesTableName = "odm_dv_variables_wlocnm"; ODws.SitesTableName = "odm_dv_sites"; ODws.SeriesTableName = "odm_dv_SeriesCatalog_all"; dvSvc = new GetValuesDailyUSGS(ConfigurationManager.AppSettings["USGSDVUrl"]); // #endregion }
public void GetValuesTest() { GetValuesDailyUSGS target = new GetValuesDailyUSGS(); NwisWOFTest.NwisWOFService_GetValuesUSGSAccessor accessor = new NwisWOFTest.NwisWOFService_GetValuesUSGSAccessor(target); locationParam Location = new locationParam("NWIS:10263500"); VariableParam Variable = new VariableParam("NWIS:00060"); System.Nullable <WaterOneFlowImpl.W3CDateTime> BeginDateTime = new W3CDateTime(DateTime.Parse("2005-08-01")); System.Nullable <WaterOneFlowImpl.W3CDateTime> EndDateTime = new W3CDateTime(DateTime.Parse("2006-08-01")); //TimeSeriesResponseType expected = null; TimeSeriesResponseType actual; actual = accessor.GetValues(Location, Variable, BeginDateTime, EndDateTime); Assert.IsNotNull(actual, "NwisWOFService.GetValuesUSGS.GetValues returned null."); // (expected, actual, "NwisWOFService.GetValuesUSGS.GetValues did not return the expected value."); // Assert.Inconclusive("Verify the correctness of this test method."); }
public void ConstructorTest() { GetValuesDailyUSGS target = new GetValuesDailyUSGS(); // TODO: Implement code to verify target //Assert.Inconclusive("TODO: Implement code to verify target"); }
public Service_DV_1_0_scrape() { //log4net.Util.LogLog.InternalDebugging = true; log.Info("Starting " + "NWISDV"); // ODws = new WofService(this.Context);//INFO we can extend this for other service types //ODws = new GetDataInformationDailyDB(); ODws = new GetDataInformationDB(); // configure ConnectionStringSettings oddb = ConfigurationManager.ConnectionStrings["ODDB"]; ODws.DataInfoConnection = oddb.ConnectionString; ODws.VariablesTableName = "odm_dv_variables"; ODws.SitesTableName = "odm_dv_sites"; ODws.SeriesTableName = "odm_dv_SeriesCatalog"; dvSvc = new GetValuesDailyUSGS(); try { useODForValues = Boolean.Parse(ConfigurationManager.AppSettings["UseODForValues"]); } catch (Exception e) { String error = "Missing or invalid value for UseODForValues. Must be true or false"; log.Fatal(error); throw new SoapException("Invalid Server Configuration. " + error, new XmlQualifiedName(SoapExceptionGenerator.ServerError)); } try { requireAuthToken = Boolean.Parse(ConfigurationManager.AppSettings["requireAuthToken"]); } catch (Exception e) { String error = "Missing or invalid value for requireAuthToken. Must be true or false"; log.Fatal(error); throw new SoapException(error, new XmlQualifiedName(SoapExceptionGenerator.ServerError)); } }
static void Main(string[] args) { Console.WriteLine("USGS DailyValuesTester"); Console.WriteLine("Use Raw USGS values"); while (true) { //Console.WriteLine("Agency:"); //String agency = Console.ReadLine(); //Console.WriteLine("Site:"); //String site = Console.ReadLine(); //Console.WriteLine("VariableCode:"); //String vcode = Console.ReadLine(); //Console.WriteLine("Statistic:"); //String stat = Console.ReadLine(); //Console.WriteLine("BeginDate"); //String bDate = Console.ReadLine(); //Console.WriteLine("EndDate"); //String eDate = Console.ReadLine(); String agency = "USGS"; String site = "01464600"; String vcode = "00010"; String stat = "00001"; String bDate = "1980-07-01"; String eDate = "1980-08-01"; Console.WriteLine("HIT return"); Console.ReadLine(); GetValuesDailyUSGS target = new GetValuesDailyUSGS(); gov.usgs.nwis.dailyValues.GetWSService svc = new gov.usgs.nwis.dailyValues.GetWSService(); //string result = svc.getDV(site, vcode, stat, bDate, eDate, agency); //Console.WriteLine(result); // original usgs link //gov.usgs.nwis.dailyValues.TimeSeriesResponseType response = svc.getDV(site, // vcode, stat, // bDate, eDate, // agency); //gov.usgs.nwis.dailyValues. dvmessage = new getDVRequest(); //dvmessage.siteNum = site; //dvmessage.parameterCode = vcode; //dvmessage.statisticCode = stat; //dvmessage.startDate = bDate; //dvmessage.endDate = eDate; //dvmessage.agencyCode = agency; gov.usgs.nwis.dailyValues.TimeSeriesResponseType response = svc.getDV(site, vcode, stat, bDate, eDate, agency); StringBuilder sb = new StringBuilder(); // Create an XmlRootAttribute overloaded constructer //and set its namespace. XmlRootAttribute tsXmlRootAttribute = new XmlRootAttribute("timeSeriesResponse"); XmlSerializer xs = new XmlSerializer( typeof(gov.usgs.nwis.dailyValues.TimeSeriesResponseType), tsXmlRootAttribute); XmlWriter writer = XmlWriter.Create(sb); xs.Serialize(writer, response); Console.WriteLine(sb.ToString()); ; } }