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


C# Service.ShutdownCallableSession方法代码示例

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


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

示例1: Execute


//.........这里部分代码省略.........
                                }
                            }

                            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();
                            }

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

                            try
                            {
                                webServ.ShutdownCallableSession(runrepSessionID);
                                log.InfoFormat(job.KeyCode, "Shut down SOAP session OK. [Runrep ID: {0}]", runrepSessionID);
                            }
                            catch (Exception ex)
                            {
                                retval = -1;
                                log.ErrorFormat(job.KeyCode, "Error shutting down SOAP session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                            }

                            ifRetry = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            webServ.ShutdownCallableSession(runrepSessionID);
                            retval = -1;
                            log.InfoFormat(job.KeyCode, "Shut down SOAP session OK {0}.", runrepSessionID);
                        }
                        catch (Exception exx)
                        {
                            log.WarnFormat(job.KeyCode, "Error shutting down SOAP session: {0} [Runrep ID: {1}]", exx, runrepSessionID);
                        }

                        log.ErrorFormat(job.KeyCode, "Error encountered in SOAP report: {0}", ex);

                        if (DateTime.Now.CompareTo(runStartTime.AddMinutes(minutesSoapRetry)) < 0)
                        {
                            isContingency = true;
                            runrepSessionID = String.Empty;
                            ifRetry = ifOverrideSoapErrorRetry ? false : true;
                            if (!ListTo.Equals(String.Empty))
开发者ID:BrianGoff,项目名称:BITS,代码行数:67,代码来源:GenevaSoapReport+-+Copy.cs

示例2: Execute


//.........这里部分代码省略.........
                            }

                            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)
                            {
                                retval = -1;
                                log.WarnFormat(job.KeyCode, "Error shutting down SOAP session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                            }

                            ifRetry = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            webServ.ShutdownCallableSession(runrepSessionID);
                            retval = -1;
                            log.InfoFormat(job.KeyCode, "Shut down SOAP session OK {0}.", runrepSessionID);
                        }
                        catch (Exception exx)
                        {
                            log.WarnFormat(job.KeyCode, "Error shutting down SOAP session: {0} [Runrep ID: {1}]", exx, runrepSessionID);
                        }

                        log.ErrorFormat(job.KeyCode, "Error encountered in SOAP connection: {0}", ex);

                        try
                        {
                            if (DateTime.Now.CompareTo(runStartTime.AddMinutes(minutesSoapRetry)) < 0)
                            {
                                isContingency = true;
                                runrepSessionID = String.Empty;
开发者ID:BrianGoff,项目名称:BITS,代码行数:67,代码来源:GenevaSoapReport2+-+GenevaTestingCopy.cs

示例3: Execute


//.........这里部分代码省略.........
                                        {
                                            if (!dr["Status"].ToString().Equals(lastStatus))
                                            {
                                                mailEnvelop += String.Format("Status: {0}<br>", dr["Status"].ToString());
                                                lastStatus = dr["Status"].ToString();
                                            }

                                            if (!dr["Message"].ToString().Equals(lastmsgg))
                                            {
                                                mailEnvelop += String.Format("Message: {0}<br>", dr["Message"].ToString());
                                                lastmsgg = dr["Message"].ToString();
                                            }

                                            mailEnvelop += String.Format("Trade Id: {0}<br>", dr["KeyValue"].ToString());
                                        }
                                    }
                                    catch (ApplicationException aex)
                                    {
                                        //bubble up application exception.  this difference here is that we'll avoid the web service retry loop
                                        throw new ApplicationException(aex.Message);
                                    }
                                    catch (Exception ex)
                                    {
                                        log.ErrorFormat(jobKeyCode, "Failed to run Callable Loader session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                        retval = StateEnums.Status.Warnings;
                                        throw new System.Web.Services.Protocols.SoapException();
                                    }

                                    if (isContingency)
                                        SendMailMessage(jobKeyCode, mail_distribution, "BITS,[email protected]", Subject, "Geneva SOAP call succeeded.");

                                    try
                                    {
                                        webServ.ShutdownCallableSession(runrepSessionID);
                                        retval = StateEnums.Status.Warnings;
                                        log.InfoFormat(jobKeyCode, "Shut down SOAP session OK {0}.", runrepSessionID);
                                    }
                                    catch (Exception ex)
                                    {
                                        log.WarnFormat(jobKeyCode, "Error shutting down SOAP session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                    }

                                    recCountSuccess++;
                                    ifRetry = false;
                                }

                                catch (ApplicationException aex)
                                {
                                    //use this type of exception to avoid the web service retry loop
                                    try
                                    {
                                        webServ.ShutdownCallableSession(runrepSessionID);
                                        ifRetry = false;
                                        retval = StateEnums.Status.Warnings;
                                        log.InfoFormat(jobKeyCode, "Shut down SOAP session OK {0}.", runrepSessionID);
                                        log.WarnFormat(jobKeyCode, "Bailing out of Geneva Update because of application error [{0}]", aex.Message);
                                    }
                                    catch (Exception ex)
                                    {
                                        log.WarnFormat(jobKeyCode, "Error shutting down SOAP session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                    }
                                }
                                catch (Exception wex)
                                {
                                    try
                                    {
开发者ID:BrianGoff,项目名称:BITS,代码行数:67,代码来源:GenevaSoapUpdate.cs

示例4: Execute


//.........这里部分代码省略.........
                                if(inputData.ContainsKey("RunDate")) 
                                    DateTime.TryParse(inputData["RunDate"].ToString(), out rundate);

                                _query = _query.Replace("\r\n", "").Replace("\n", "");
                                _query = _query.Replace("FROM", " FROM").Replace("GIVEN", " GIVEN").Replace("WHERE", " WHERE").Replace("TYPE", " TYPE").Replace("ORDER", " ORDER");
                                _query = _query.TrimEnd(';');

                                //Meta Tag replacement on mudule properties happens at job's launch
                                //if (rundate.Equals(DateTime.MinValue))
                                //    rundate = ((State)this.ExecutionEngine.GetJobState(this.job.JobName)).CurrentParameters.ProcessInputDates.InDate;
                                //    _query = ConfigUtils.MetaTagReplacer(_query);
                                //else
                                //    _query = ConfigUtils.MetaTagReplacer(_query,rundate);
                                if (!rundate.Equals(DateTime.MinValue))
                                    _query = MetaTagReplacer.InlineMetatagSubstitution(_query, rundate);

                                selectReturn = webServ.RunCallableRunrepRunSelect(runrepSessionID, _query, "") as runrepResultsPortfolioStruct;
                                log.InfoFormat(((State)o).CurrentJobHash, "Runrep select was successful [Runrep ID: {0}]: {1}", runrepSessionID, _query);
                            }
                            catch (Exception ex)
                            {
                                log.ErrorFormat(((State)o).CurrentJobHash, "Failed to select from runrep session: {0}", ex);
                                errors += "<br>" + ex.Message;
                                throw new System.Web.Services.Protocols.SoapException("Failed to select from runrep session", System.Xml.XmlQualifiedName.Empty);
                            }

                            if (isContingency)
                                //SendMailMessage(((State)o).CurrentJobHash, ConfigUtils.MetaTagReplacer("*SOAP_ERROR_DISTRIBUTION*"), "BITS,[email protected]", Subject, "Geneva SOAP call succeeded.");
                                SendMailMessage(((State)o).CurrentJobHash, mailDistribution, "BITS,[email protected]", Subject, "Geneva SOAP call succeeded.");


                            try
                            {
                                webServ.ShutdownCallableSession(runrepSessionID);
                                log.Info(((State)o).CurrentJobHash, "Shut down SOAP session OK.");
                            }
                            catch (Exception ex)
                            {
                                log.WarnFormat(((State)o).CurrentJobHash, "Error shutting down SOAP session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                                retval = StateEnums.Status.Warnings;
                            }

                            ifRetry = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            webServ.ShutdownCallableSession(runrepSessionID);
                            retval = StateEnums.Status.Warnings;
                            log.InfoFormat(((State)o).CurrentJobHash, "Shut down SOAP session OK {0}.", runrepSessionID);
                        }
                        catch (Exception exx)
                        {
                            log.WarnFormat(((State)o).CurrentJobHash, "Error shutting down SOAP session: {0} [Runrep ID: {1}]", exx, runrepSessionID);
                        }

                        log.ErrorFormat(((State)o).CurrentJobHash, "Error encountered in SOAP select: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                        errors += "<br>" + ex.Message;

                        if (DateTime.Now.CompareTo(runStartTime.AddMinutes(minutesSoapRetry)) < 0)
                        {
                            isContingency = true;
                            runrepSessionID = String.Empty;
                            ifRetry = ifOverrideSoapErrorRetry ? false : true;
开发者ID:BrianGoff,项目名称:BITS,代码行数:67,代码来源:GenevaSoapSelect.cs

示例5: Execute


//.........这里部分代码省略.........
                            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)
                        {
                            string msg = String.Format("Runrep read report file {0} was NOT successful [Runrep ID: {1}]<br>Error: {2}", rsl, runrepSessionID, ex);
                            throw new ApplicationException(msg);
                        }

                        try
                        {
                            results = webServ.RunCallableRunrepRunReport(runrepSessionID, rsl, localArgs);
                            log.InfoFormat(((State)o).CurrentJobHash, "Runrep run report {0} {1} was successful [Runrep ID: {2}]", rsl, localArgs, runrepSessionID);
                        }
                        catch (Exception ex)
                        {
                            string msg = String.Format("Runrep run report {0} {1} was successful [Runrep ID: {2}]<br>Error: {3}", rsl, localArgs, runrepSessionID, ex);
                            throw new ApplicationException(msg);
                        }

                        try
                        {
                            webServ.ShutdownCallableSession(runrepSessionID);
                            log.InfoFormat(((State)o).CurrentJobHash, "Shut down SOAP session OK. [Runrep ID: {0}]", runrepSessionID);
                        }
                        catch (Exception ex)
                        {
                            log.WarnFormat(((State)o).CurrentJobHash, "Error shutting down SOAP session: {0} [Runrep ID: {1}]", ex, runrepSessionID);
                        }

                        if (isContingency)
                        {
                            string msg = "Geneva SOAP call succeeded.";
                            msgMailer += String.Format("{0}<br><br>", msg);
                        
                            ///TO DO Replace this code with more central approach
							//string subject = ConfigUtils.MetaTagReplacer("GENEVA CONNECTION ERROR [*RUN_INSTANCE*])");
                            //SendMailMessage(((State)o).CurrentJobHash, ConfigUtils.MetaTagReplacer("*SOAP_ERROR_DISTRIBUTION*"), "BITS,[email protected]", subject, msgMailer);
                            SendMailMessage(((State)o).CurrentJobHash, mail_distribution, "BITS,[email protected]", mail_subject, msgMailer);
                        }

                        ifRetry = false;
                        isContingency = false;
                    }
                    catch (Exception ex)
                    {
                        string msg = ex.ToString();
                        log.ErrorFormat(((State)o).CurrentJobHash, "{0}", msg);
                        msgMailer += String.Format("{0}<br><br>", msg);

                        try
                        {
                            webServ.ShutdownCallableSession(runrepSessionID);
                            log.InfoFormat(((State)o).CurrentJobHash, "Shut down SOAP session OK {0}.", runrepSessionID);
                        }
开发者ID:BrianGoff,项目名称:BITS,代码行数:67,代码来源:GenevaSoapReport2.cs

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