Exemplo n.º 1
0
            public SiteInfoResponseType GetSiteInfo(string locationParameter)
            {
                string siteId = locationParameter.Substring(locationParameter.LastIndexOf(":") + 1);

                SiteInfoResponseType resp = new SiteInfoResponseType();

                resp.site    = new SiteInfoResponseTypeSite[1];
                resp.site[0] = new SiteInfoResponseTypeSite();
                resp.site[0] = WebServiceUtils.GetSiteFromDb(siteId, true);

                resp.queryInfo = CuahsiBuilder.CreateQueryInfoType("GetSiteInfo", new string[] { locationParameter }, null, null, null, null);

                return(resp);
            }
Exemplo n.º 2
0
            public SiteInfoResponseType GetSiteInfo(string[] locationParameter, Boolean IncludeSeries)
            {
                Stopwatch timer = System.Diagnostics.Stopwatch.StartNew();

                if (locationParameter != null)
                {
                    queryLog2.LogStart(CustomLogging.Methods.GetSiteInfo, locationParameter.ToString(),
                                       appContext.Request.UserHostName);
                }
                else
                {
                    queryLog2.LogStart(CustomLogging.Methods.GetSiteInfo, "NULL",
                                       appContext.Request.UserHostName);
                }
                List <locationParam> lpList = new List <locationParam>();

                try
                {
                    foreach (string s in locationParameter)
                    {
                        locationParam l = new locationParam(s);

                        if (l.isGeometry)
                        {
                            String error = "Location by Geometry not accepted: " + locationParameter;
                            log.Debug(error);
                            throw new WaterOneFlowException(error);
                        }
                        else
                        {
                            lpList.Add(l);
                        }
                    }
                }
                catch (WaterOneFlowException we)
                {
                    log.Error(we.Message);
                    throw;
                }
                catch (Exception e)
                {
                    String error =
                        "Sorry. Your submitted site ID for this getSiteInfo request caused an problem that we failed to catch programmatically: " +
                        e.Message;
                    log.Error(error);
                    throw new WaterOneFlowException(error);
                }
                SiteInfoResponseType resp = new SiteInfoResponseType();

                resp.site = new SiteInfoResponseTypeSite[locationParameter.Length];
                for (int i = 0; i < locationParameter.Length; i++)
                {
                    resp.site[i] = WebServiceUtils.GetSiteFromDb(locationParameter[0], true);
                }

                foreach (SiteInfoResponseTypeSite site in resp.site)
                {
                    foreach (seriesCatalogType catalog in site.seriesCatalog)
                    {
                        catalog.menuGroupName = serviceName;
                        catalog.serviceWsdl   = serviceUrl;
                    }
                }

                if (locationParameter != null)
                {
                    queryLog2.LogEnd(CustomLogging.Methods.GetSiteInfo,
                                     locationParameter.ToString(),
                                     timer.ElapsedMilliseconds.ToString(),
                                     resp.site.Length.ToString(),
                                     appContext.Request.UserHostName);
                }
                else
                {
                    queryLog2.LogEnd(CustomLogging.Methods.GetSiteInfo,
                                     "NULL",
                                     timer.ElapsedMilliseconds.ToString(),
                                     resp.site.Length.ToString(),
                                     appContext.Request.UserHostName);
                }

                return(resp);
            }