Beispiel #1
0
        } // end GetRtmLmps() method

        public string GetReport(string reportTypeID)
        {
            LogDebug("Calling GetReport() method...");
            _marketCallType = MarketInfoCallType.Report;
            try
            {
                RequestMessageBuilder requestBuilder = new RequestMessageBuilder(SOURCE, CLIENT_CERT_USER_ID);
                RequestMessage        requestmsg     = requestBuilder.GetReports(null, null, reportTypeID);


                LogDebug("Attempting to call Ercot GetReports service...");

                ResponseMessage response = _ercotClient.MarketInfo(requestmsg);
                LogDebug("Calling ExtractReportFromResponsePayload() method...");
                Report report = ExtractReportFromResponsePayload(response.Payload);
                LogDebug("Creating ScreenScraper object...");
                ScreenScraper sc = new ScreenScraper();
                LogDebug("Extracting csv report contents from zip file...");
                string csv_report_contents = sc.ExtractCsvFileForReportInMemory(report);
                return(csv_report_contents);
            }
            catch (System.Web.Services.Protocols.SoapHeaderException she)
            {
                LogError(she);
                LogDebug(she);
                throw new Exception($"From {System.Reflection.MethodBase.GetCurrentMethod().ToString()}: SOAP Header Exception...");
            }

            catch (System.Reflection.TargetInvocationException te)
            {
                LogError(te);
                LogDebug(te);
                throw new Exception($"From {System.Reflection.MethodBase.GetCurrentMethod().ToString()}: SOAP Header Exception...");
            }

            catch (Exception ex)
            {
                LogError(ex);
                LogDebug(ex);
                throw new Exception($"From {System.Reflection.MethodBase.GetCurrentMethod().ToString()}: SOAP Header Exception...");
            }
        }