【问题标题】:I'm getting a NotImplementedException when trying to call a Reporting Services Web Method尝试调用 Reporting Services Web 方法时收到 NotImplementedException
【发布时间】:2011-05-11 21:19:41
【问题描述】:

我试图从另一个 C# 函数调用 ReportingServices2005.asmx Web 服务的 GetReportParameters 方法,但出现以下错误:

System.NotImplementedException: The method or operation is not implemented.

我只是在这里复制了微软网站上的代码:

Get Parameters Example

这是代码:

            bool forRendering = false;
            string historyID = null;
            ParameterValue[] values = null;
            DataSourceCredentials[] credentials = null;
            ReportParameter[] parameters = null;

            try
            {
                parameters = rs.GetReportParameters(reportName,historyID, forRendering, values,credentials);

                if (parameters != null)
                {
                    foreach (ReportParameter rp in parameters)
                    {
                        Console.WriteLine("Name: {0}", rp.Name);
                    }
                }
            }

            catch (SoapException e)
            {
                error = e.Detail.InnerXml.ToString();
            }

其中reportName 是带有报告名称的字符串。

有什么想法吗??

提前致谢!

编辑

这是完整的堆栈跟踪:

System.NotImplementedException: The method or operation is not implemented.
at Foo.Foo.ReportingService2005.GetReportParameters(String reportName, String historyID, Boolean forRendering, ParameterValue[] values, DataSourceCredentials[] credentials) in C:\Visual Studio Projects\Foo\Foo\Web References\Foo\Reference.cs:line 4112
at Foo.Foo.GetReportParameters(String username, String password, String reportName) in C:\Visual Studio Projects\Foo\Foo\Foo.asmx.cs:line 265

【问题讨论】:

  • 你能在你的问题中添加更多的堆栈跟踪吗?通常 IME 必须从主体仅包含 throw new NotImplementedException(); 的方法中显式抛出 NotImplementedException
  • 我添加了堆栈跟踪,它看起来与“Resources.cs”产生了共鸣......我什至不确定该文件在我的项目中的位置......

标签: c# .net reporting-services


【解决方案1】:

我删除并重新添加了 Web 参考,但这并没有解决问题,但经过大量试验和错误后,我注意到

ParameterValue[] values = null;
DataSourceCredentials[] credentials = null;
ReportParameter[] parameters = null;

都在引用另一个 Web 参考......甚至不确定这怎么可能。但是,我删除了另一个与 Reporting Services 无关的 Web 参考,现在一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-09-17
    • 1970-01-01
    • 2021-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    相关资源
    最近更新 更多