我在尝试调用 Reporting Services Web 方法时收到 NotImplementedException

发布于 2024-11-07 03:42:35 字数 1863 浏览 0 评论 0原文

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

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

我只是从 Microsoft 网站复制了代码:

获取参数示例

即以下代码:

            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

I am trying to call the GetReportParameters method from the ReportingServices2005.asmx web service from another C# function and I am getting the following error:

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

I litterally just copied the code from Microsoft's site here:

Get Parameters Example

which is this code:

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

Where reportName is a string with the name of the report.

Any ideas??

Thanks in advance!

EDIT

Here is the full stack trace:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅笑轻吟梦一曲 2024-11-14 03:42:35

我删除并重新添加了 Web 引用,但这并没有解决问题,但是经过大量的试验和错误,我注意到我们

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

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

I deleted and re-added the Web Reference and this didn't do the trick, but after lots of trial and error I noticed that

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

Were all referencing another Web Reference.... Not even sure how that's possible.. But, I deleted the other Web Reference that had nothing to do with Reporting Services and all is now working.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文