Esempio n. 1
0
        public SiteInfoResponseType GetSiteInfo(string locationParameter)
        {
            Stopwatch timer = System.Diagnostics.Stopwatch.StartNew();

            queryLog2.LogStart(Logging.Methods.GetSiteInfo, locationParameter,
                               appContext.Request.UserHostName);
            locationParam lp = null;

            try
            {
                lp = new locationParam(locationParameter);
                if (lp.isGeometry)
                {
                    String error = "Location by Geometry not accepted: " + locationParameter;
                    log.Debug(error);
                    throw new WaterOneFlowException(error);
                }
            }
            catch (WaterOneFlowException we)
            {
                //waterLog.WriteEntry("Bad SiteID:" + siteId, EventLogEntryType.Information);
                log.Error(we.Message);
                throw;
            }
            catch (Exception e)
            {
                // waterLog.WriteEntry("Uncaught exception:" + e.Message, EventLogEntryType.Error);
                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);
            }
            GetSiteInfoOD getSiteInfo = new GetSiteInfoOD();

            SiteInfoResponseType resp = getSiteInfo.GetSiteInfo(lp);

            // add service location using the app context
            // for ODM, we one only seriesCatalog
            // String serviceName = (String) appContext.Session["serviceName"];
            // String serviceUrl = (String) appContext.Session["serviceUrl"];
            if (resp.site[0].seriesCatalog.Length > 0)
            {
                resp.site[0].seriesCatalog[0].menuGroupName = serviceName;
                resp.site[0].seriesCatalog[0].serviceWsdl   = serviceUrl;
            }
            queryLog2.LogEnd(Logging.Methods.GetSiteInfo,
                             locationParameter,
                             timer.ElapsedMilliseconds.ToString(),
                             resp.site.Length.ToString(),
                             appContext.Request.UserHostName);

            return(resp);
        }
        public SiteInfoResponseType GetSiteInfo(string locationParameter)
        {
            Stopwatch timer = System.Diagnostics.Stopwatch.StartNew();

            queryLog2.LogStart(Logging.Methods.GetSiteInfo, locationParameter,
                appContext.Request.UserHostName);
            locationParam lp = null;
            try
            {
                lp = new locationParam(locationParameter);
                if (lp.isGeometry)
                {
                    String error = "Location by Geometry not accepted: " + locationParameter;
                    log.Debug(error);
                    throw new WaterOneFlowException(error);
                }
            }
            catch (WaterOneFlowException we)
            {
                //waterLog.WriteEntry("Bad SiteID:" + siteId, EventLogEntryType.Information);
                log.Error(we.Message);
                throw;
            }
            catch (Exception e)
            {
                // waterLog.WriteEntry("Uncaught exception:" + e.Message, EventLogEntryType.Error);
                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);
            }
            GetSiteInfoOD getSiteInfo = new GetSiteInfoOD();

            SiteInfoResponseType resp = getSiteInfo.GetSiteInfo(lp);

            // add service location using the app context
            // for ODM, we one only seriesCatalog
            // String serviceName = (String) appContext.Session["serviceName"];
            // String serviceUrl = (String) appContext.Session["serviceUrl"];
            if (resp.site[0].seriesCatalog.Length > 0)
            {
                resp.site[0].seriesCatalog[0].menuGroupName = serviceName;
                resp.site[0].seriesCatalog[0].serviceWsdl = serviceUrl;
            }
            queryLog2.LogEnd(Logging.Methods.GetSiteInfo,
                locationParameter,
                timer.ElapsedMilliseconds.ToString(),
                resp.site.Length.ToString(),
                    appContext.Request.UserHostName);

            return resp;
        }