Reporting services Quartz.net windows服务不执行引用SRS web服务的作业

Reporting services Quartz.net windows服务不执行引用SRS web服务的作业,reporting-services,tcp,windows-services,quartz-scheduler,quartz.net,Reporting Services,Tcp,Windows Services,Quartz Scheduler,Quartz.net,我使用了ssrs reporting execution service的两个web引用来生成报告。我正在使用quartz.net windows服务安排ssrs报告。当我使用StdSchedulerFactory.GetDefaultScheduler()时,我的Windows服务正在工作,但当我在Quartz服务中远程执行作业并使用GetScheduler()时,它不工作 public void Execute(IJobExecutionContext context) {

我使用了ssrs reporting execution service的两个web引用来生成报告。我正在使用quartz.net windows服务安排ssrs报告。当我使用StdSchedulerFactory.GetDefaultScheduler()时,我的Windows服务正在工作,但当我在Quartz服务中远程执行作业并使用GetScheduler()时,它不工作

public void Execute(IJobExecutionContext context)
{


        RS2005.ReportingService2005 rs;
        RE2005.ReportExecutionService rsExec;



        // Create a new proxy to the web service
        rs = new RS2005.ReportingService2005();
        rsExec = new RE2005.ReportExecutionService();

        // Authenticate to the Web service using Windows credentials
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
        rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;

        rs.Url = "http://127.0.0.1:7001/ReportServer/reportservice2005.asmx";
        rsExec.Url = "http://127.0.0.1:7001/ReportServer/reportexecution2005.asmx";

        string historyID = null;
        string deviceInfo = null;
        string format = "PDF";
        Byte[] results;
        string encoding = String.Empty;
        string mimeType = String.Empty;
        string extension = String.Empty;
        RE2005.Warning[] warnings = null;
        string[] streamIDs = null;

        // Path of the Report - XLS, PDF etc.
        string fileName = "samplereport.pdf";
        // Name of the report - Please note this is not the RDL file.
        string _reportName = @"/reports_Debug/reportname";
        string _historyID = null;
        bool _forRendering = false;
        RS2005.ParameterValue[] _values = null;
        RS2005.DataSourceCredentials[] _credentials = null;
        RS2005.ReportParameter[] _parameters = null;

        try
        {
            _parameters = rs.GetReportParameters(_reportName, _historyID, _forRendering, _values, _credentials);
            RE2005.ExecutionInfo ei = rsExec.LoadReport(_reportName, historyID);
            RE2005.ParameterValue[] parameters = new RE2005.ParameterValue[8];

            if (_parameters.Length > 0)
            {

                parameters[0] = new RE2005.ParameterValue();
                parameters[0].Name = "FromDate";
                parameters[0].Value = "1/1/2016";
                parameters[1] = new RE2005.ParameterValue();
                parameters[1].Name = "ToDate";
                parameters[1].Value = "1/21/2016"; // June

            }
            rsExec.SetExecutionParameters(parameters, "en-us");

            results = rsExec.Render(format, deviceInfo,
                      out extension, out encoding,
                      out mimeType, out warnings, out streamIDs);

            using (FileStream stream = File.OpenWrite(fileName))
            {
                stream.Write(results, 0, results.Length);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
}

找到答案:服务需要特殊权限才能通过http在web上进行交互。服务的属性->使用本地帐户凭据或以管理员身份安装服务已解决问题。找到答案:服务需要特殊权限才能通过http在web上进行交互。服务的属性->使用本地帐户凭据或安装服务,因为管理员已解决问题。