当前位置: 首页>>代码示例>>C#>>正文


C# Service.RunCallableRunrepReadFile方法代码示例

本文整理汇总了C#中Service.RunCallableRunrepReadFile方法的典型用法代码示例。如果您正苦于以下问题:C# Service.RunCallableRunrepReadFile方法的具体用法?C# Service.RunCallableRunrepReadFile怎么用?C# Service.RunCallableRunrepReadFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Service的用法示例。


在下文中一共展示了Service.RunCallableRunrepReadFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public override int Execute(Object o, Hashtable inputData)
        {
            log.InfoFormat(job.KeyCode, "Module {0} received {1} inputs.", name, inputData != null ? inputData.Count.ToString() : "no");
            int retval = 0;

            if (IfResetOnEachRun)
                ResetOutput();

            PassAlongOutputs(inputData);

            PerfTimer hpt = new PerfTimer();
            hpt.Start();

            int activityIdStarting = UpdateProcessStatus(Enums.ProcessStatus.Starting, "", (State)o);
            string reportArgs = String.Empty;

            try
            {
                dtOut = new DataTable(tableName);
                Util.InitializeAsciiLookup();

                ifRetry = true;
                bool isContingency = false;
                string runrepSessionID = String.Empty;
                reportResultsPortfolioStruct results = null;
                Service webServ = null;
                int numtries = 1;

                if (!job.JobName.StartsWith("ADHOC_")) PrepareDates();
                ParseArgs(args, ref reportArgs);
                DateTime runStartTime = DateTime.Now;
                while (ifRetry)
                {
                    try
                    {
                        webServ = null;
                        while (webServ == null && numtries < 12)
                        {
                            log.InfoFormat(job.KeyCode, "Attempting Geneva SOAP RunCallableRunrepRunReport [retry #{3}] on {0} with report args {1} {2}", url, rsl, reportArgs, numtries);
                            webServ = new Service();
                            if (webServ == null)
                                Thread.Sleep(5000);
                            numtries++;
                        }

                        if (webServ == null)
                        {
                            log.WarnFormat(job.KeyCode, "Web service not constructed (null value)");
                            retval = -1;
                            throw new System.Web.Services.Protocols.SoapException();
                        }
                        else
                        {
                            log.InfoFormat(job.KeyCode, "Web service constructed successfully");

                            webServ.Timeout = timeout;
                            log.InfoFormat(job.KeyCode, "Web service timeout assigned: {0}", timeout);

                            webServ.Url = ConfigUtils.MetaTagReplacer(url);
                            log.WarnFormat(job.KeyCode, "Web url assigned: {0}", webServ.Url);

                            if (runrepSessionID.Equals(String.Empty))
                            {
                                try
                                {
                                    runrepSessionID = webServ.StartCallableRunrep(port, host, uid, pwd, "-f empty");
                                    log.InfoFormat(job.KeyCode, "Runrep session started successfully [Runrep ID: {0}]", runrepSessionID);
                                }
                                catch (Exception ex)
                                {
                                    log.ErrorFormat(job.KeyCode, "Failed to start runrep session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                    retval = -99;
                                    throw new System.Web.Services.Protocols.SoapException();
                                }
                            }

                            try
                            {
                                webServ.RunCallableRunrepReadFile(runrepSessionID, rsl);
                                log.InfoFormat(job.KeyCode, "Runrep read report file was successful [Runrep ID: {0}]", runrepSessionID);
                            }
                            catch (Exception ex)
                            {
                                log.WarnFormat(job.KeyCode, "Failed to read rsl file from runrep session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                retval = -99;
                                throw new System.Web.Services.Protocols.SoapException();
                            }

                            try
                            {
                                throw new ApplicationException(); //TESTING!!!!!!!!!!!!!!
                                results = webServ.RunCallableRunrepRunReport(runrepSessionID, rsl, reportArgs);
                                log.InfoFormat(job.KeyCode, "Runrep run report was successful [Runrep ID: {0}]", runrepSessionID);
                            }
                            catch (Exception ex)
                            {
                                log.WarnFormat(job.KeyCode, "Runrep run report was NOT successful: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                retval = -99;
                                throw new System.Web.Services.Protocols.SoapException();
                            }
//.........这里部分代码省略.........
开发者ID:BrianGoff,项目名称:BITS,代码行数:101,代码来源:GenevaSoapReport+-+Copy.cs

示例2: Execute

        public override StateEnums.Status Execute(Object o, Hashtable inputData)
        {
            log.InfoFormat(((State)o).CurrentJobHash, "Module {0} received {1} inputs.", name, inputData != null ? inputData.Count.ToString() : "no");
            StateEnums.Status retval = StateEnums.Status.Success;

            if (IfResetOnEachRun)
                ResetOutput();

            PassAlongOutputs(inputData);

            PerfTimer hpt = new PerfTimer();
            hpt.Start();

            int activityIdStarting = UpdateProcessStatus(Enums.ProcessStatus.Starting, "", (State)o);
			string reportArgs = String.Empty;

            try
            {
                //runDate is required to evaluate meta tags this module explicitely using
                //derrived from job state or passed from runDateString
                //if (DateTime.TryParse(RunDate, out runDate))
                //    runDateParms = new MetaTagReplacerInputDates(runDate);
                //else
                //    runDateParms = ((State)this.ExecutionEngine.GetJobState(this.job.JobName)).CurrentParameters.ProcessInputDates;

                runDateParms = ((State)o).CurrentParameters.GetModuleInDatesOverride(this.Name);
                if (runDateParms == null)
                    runDateParms = ((State)o).CurrentParameters.ProcessInputDates;

                string mail_subject = string.Format("GENEVA CONNECTION ERROR [{0}])",
                                                                    MetaTagReplacer.GetMetaTagValue("*RUN_INSTANCE*", runDateParms, null));
                string  mail_distribution =  MetaTagReplacer.GetMetaTagValue("*SOAP_ERROR_DISTRIBUTION*", runDateParms, null);

                dtOut = new DataTable(tableName);
                Util.InitializeAsciiLookup();

                ifRetry = true;
                bool isContingency = false;
                string runrepSessionID = String.Empty;
                reportResultsPortfolioStruct results = null;
                Service webServ = null;
                int numtries = 1;

				DateTime runStartTime = DateTime.Now;
                string msgMailer = "";
                string localArgs = ParseArgs(args);

                while (ifRetry)
                {
                    try
                    {
                        webServ = null;

                        log.InfoFormat(((State)o).CurrentJobHash, "Attempting Geneva SOAP RunCallableRunrepRunReport [retry #{3}] on {0} with report args {1} {2}", url, rsl, localArgs, numtries);
                        webServ = new Service();
                        if (webServ == null)
                        {
                            string msg = "Web service not constructed (null value).";
                            throw new ArgumentNullException(msg);
                        }
                        log.InfoFormat(((State)o).CurrentJobHash, "Web service constructed successfully");
                        

                        webServ.Timeout = timeout;
                        log.InfoFormat(((State)o).CurrentJobHash, "Web service timeout assigned: {0}", timeout);

						 /* Old style processing of properties
                        webServ.Url = ConfigUtils.MetaTagReplacer(url);
						*/
						webServ.Url = this.Url;
                        log.InfoFormat(((State)o).CurrentJobHash, "Web url assigned: {0}", webServ.Url);


                        if (runrepSessionID.Equals(String.Empty))
                        {
                            //string flags = String.Format("-n{0} -f empty", DateTime.Now.ToString("mmss"));
                            string flags = String.Format("-f empty");
                            try
                            {
                                runrepSessionID = webServ.StartCallableRunrep(port, host, uid, pwd, flags);
                                //runrepSessionID = webServ.StartPersistentCallableRunrep(port, host, uid, pwd, flags); 
                                log.InfoFormat(((State)o).CurrentJobHash, "Runrep session started successfully with flags \"{0}\" [Runrep ID: {1}]", flags, runrepSessionID);
								log.DebugFormat(((State)o).CurrentJobHash, "Runrep session {0} started successfully for call {1} {2} {3} {4}", runrepSessionID, webServ.Url, rsl, localArgs,  flags );
                            }
                            catch (Exception ex)
                            {
                                log.DebugFormat(((State)o).CurrentJobHash, "Runrep session {0} NOT started successfully for call {1} {2} {3} {4}", runrepSessionID, webServ.Url, rsl, localArgs, flags);
								string msg = String.Format("Runrep session NOT started with flags \"{0}\" [Runrep ID: {1}]<br>Error: {2}", flags, runrepSessionID, ex);
								throw new ApplicationException(msg);
                            }
                        }


                        try
                        {
                            webServ.RunCallableRunrepReadFile(runrepSessionID, rsl);
                            log.InfoFormat(((State)o).CurrentJobHash, "Runrep read report file {0} was successful [Runrep ID: {1}]", rsl, runrepSessionID);
                        }
                        catch (Exception ex)
                        {
//.........这里部分代码省略.........
开发者ID:BrianGoff,项目名称:BITS,代码行数:101,代码来源:GenevaSoapReport2.cs

示例3: Execute


//.........这里部分代码省略.........
                                    flagIdInUse = safeFlags.Next();
                                    //flags = String.Format("-n{0} -f empty", flagIdInUse);
                                    flags = String.Format("-n{0}", flagIdInUse);

                                    log.DebugFormat(job.KeyCode, "flags={0}", flags);


                                    string login = webServ.MonitorLogin("SysReports", "reports1");
                                    webServ.MonitorAddUser(login, "SysReports");
                                    Console.Write(webServ.GetGenevaIniInfo(runrepSessionID, "/usr/advent/geneva-qa"));

                                    Console.Write(webServ.GetAgaFileUtilityInfo(runrepSessionID, 0, "", "", "agb-geneva"));
                                    Console.Write(webServ.GetAllAgaFileUtilitiesForNewAgaInfo(runrepSessionID,0,"","","agb-geneva"));
                                    Console.Write(webServ.GetAllChildrenForMotherInfo(runrepSessionID, 0, "", "", "agb-geneva"));
                                    Console.Write(webServ.GetRepEngineInfo(runrepSessionID, 0, "", "", "agb-geneva"));
                                    Console.Write(webServ.GetRepQueueInfo(runrepSessionID, 0, "", "", "agb-geneva"));
                                    Console.Write(webServ.GetRunrepInfo(runrepSessionID, 0, "", "", "agb-geneva"));


                                    //runrepSessionID = webServ.StartPersistentCallableRunrep(port, host, uid, pwd, flags);  // StartCallableRunrep(port, host, uid, pwd, flags);
                                    runrepSessionID = webServ.StartCallableRunrep(port, host, uid, pwd, flags);  // StartCallableRunrep(port, host, uid, pwd, flags);
                                    log.InfoFormat(job.KeyCode, "Runrep session started successfully [Runrep ID: {0}]", runrepSessionID);
                                }
                                catch (Exception ex)
                                {
                                    log.ErrorFormat(job.KeyCode, "Failed to start runrep session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                    retval = -99;
                                    throw new ApplicationException(ex.ToString());
                                }
                            }

                            try
                            {
                                webServ.RunCallableRunrepReadFile(runrepSessionID, rsl);
                                log.InfoFormat(job.KeyCode, "Runrep read report file was successful [Runrep ID: {0}]", runrepSessionID);
                            }
                            catch (Exception ex)
                            {
                                log.WarnFormat(job.KeyCode, "Failed to read rsl file from runrep session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                retval = -99;
                                throw new ApplicationException(ex.ToString());
                            }

                            try
                            {
                                results = webServ.RunCallableRunrepRunReport(runrepSessionID, rsl, reportArgs);
                                log.InfoFormat(job.KeyCode, "Runrep run report was successful [Runrep ID: {0}]", runrepSessionID);
                            }
                            catch (Exception ex)
                            {
                                log.WarnFormat(job.KeyCode, "Runrep run report was NOT successful: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                retval = -99;
                                throw new ApplicationException(ex.ToString());
                            }

                            if (isContingency)
                                SendMailMessage(job.KeyCode, job.Config.SoapErrorEmailDistribution, ListFrom, Subject, "Geneva SOAP call succeeded.");

                            try
                            {
                                safeFlags[flagIdInUse]= false;

                                webServ.ShutdownCallableSession(runrepSessionID);
                                log.InfoFormat(job.KeyCode, "Shut down SOAP session OK. [Runrep ID: {0}]", runrepSessionID);
                            }
                            catch (Exception ex)
开发者ID:BrianGoff,项目名称:BITS,代码行数:67,代码来源:GenevaSoapReport2+-+GenevaTestingCopy.cs

示例4: Execute

        public override StateEnums.Status Execute(Object o, Hashtable inputData)
        {
            log.InfoFormat(((State)o).CurrentJobHash, "Module {0} received {1} inputs.", name, inputData != null ? inputData.Count.ToString() : "no");

            PerfTimer hpt = new PerfTimer();
            hpt.Start();

            int activityIdStarting = UpdateProcessStatus(Enums.ProcessStatus.Starting, "", (State)o);

            if (IfResetOnEachRun)
                ResetOutput();

            PassAlongOutputs(inputData);

            string reportArgs = args; //changed from String.Empty as args s/b set by job launch
            int numrecs = 0;
            int numrecsFiltered = 0;
            StateEnums.Status retval = StateEnums.Status.Success;

            try
            {
                dtOut = new DataTable(tableName);

                //Deprecated - Args  and properties s/b set by JobLaunch 
                //PrepareDates();
                //ParseArgs(args, ref reportArgs);
                runDate = Convert.ToDateTime(runDateString);

                log.InfoFormat(((State)o).CurrentJobHash, "Setting up Geneva SOAP report call.");

                string runrepSessionID = String.Empty;

                Service webServ = new Service();
                webServ.Url = url; // URL s/b set by job launch // ConfigUtils.MetaTagReplacer(url);

                reportResultsPortfolioStruct results = null;

                webServ.Timeout = timeout;

                ifRetry = true;
                bool isContingency = false;
                DateTime runStartTime = DateTime.Now;
                while (ifRetry)
                {
                    try
                    {
                        log.InfoFormat(((State)o).CurrentJobHash, "Attempting Geneva SOAP RunCallableRunrepRunReport call on {0} with report args {1} {2}", url, reportName, reportArgs);

                        if (runrepSessionID.Equals(String.Empty))
                            runrepSessionID = webServ.StartCallableRunrep(port, host, uid, pwd, String.Empty);

                        webServ.RunCallableRunrepReadFile(runrepSessionID, reportName);

                        results = webServ.RunCallableRunrepRunReport(runrepSessionID, reportName, reportArgs);

                        if (isContingency)
                            SendMailMessage(((State)o).CurrentJobHash, ListTo, ListFrom, Subject, "Geneva SOAP call succeeded.");

                        ifRetry = false;
                    }
                    catch (Exception ex)
                    {
                        log.Error(((State)o).CurrentJobHash, ex);

                        if (DateTime.Now.CompareTo(runStartTime.AddMinutes(minutesSoapRetry)) < 0)
                        {
                            isContingency = true;
                            if (!ListTo.Equals(String.Empty))
                                SendMailMessage(((State)o).CurrentJobHash, ListTo, ListFrom, Subject, ex.ToString());
                            Thread.Sleep(60000);
                        }
                        else
                        {
                            SendMailMessage(((State)o).CurrentJobHash, ListTo, ListFrom, Subject, "Geneva SOAP call timed out. Giving up now.");
                            ifRetry = false;
                        }
                    }
                }

                dtOut = ConvertToDataTable(tableName, results);
                log.InfoFormat(((State)o).CurrentJobHash, "Obtained {0} records from SOAP service call.", dtOut.Rows.Count);

                if (dtOut != null)
                {
                    AddToOutputs(this.Name, dtOut);
                    AddToOutputs("RunDate", runDate);
                }

                try
                {
                    webServ.ShutdownCallableSession(runrepSessionID);
                }
                catch (Exception ex)
                {
                    log.Warn(((State)o).CurrentJobHash, ex);
                }
            }
            catch (Exception ex)
            {
                log.Error(((State)o).CurrentJobHash, ex);
//.........这里部分代码省略.........
开发者ID:BrianGoff,项目名称:BITS,代码行数:101,代码来源:GenevaAddendumErrors.cs


注:本文中的Service.RunCallableRunrepReadFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。