通过URL将参数传递给服务 - 如何发现参数名称?
问题描述:
我有一个报告,我有只执行访问 - 我没有访问RDL文件。这份报告公开了一些我想从URL中设置的参数。通过URL将参数传递给服务 - 如何发现参数名称?
我已经成功地改变了使用标准PARAM =数据形式的一些参数(如这里解释:http://msdn.microsoft.com/en-us/library/ms153586.aspx)。但是,某些参数不具有相同的参数提示和参数名称。
不幸的是,传递参数值的网址,我必须知道参数的名字,我不知道怎样才能从报告及其参数的提示文本中扣除。我试图检查源和后数据,但无济于事。
任何人有想法?
感谢
P.S我还无意中发现了这一点:http://odetocode.com/Articles/123.aspx。但是,我无法连接到我的报告服务器的Web服务。
答
唉。我正在回复自己,希望有人可以从中学习:
我做到了,最终使用了Reporting99 web服务,如here和here所述。这里要记住的一点是,该服务的名称已更改终点是ReportService2005.asmx(我从SQL Server 2005及以后相信)。
添加Web引用后,我仍然有各种问题。总而言之,这是最终为我工作的代码(注意:我处于域中,而我连接的IIS需要域Windows身份验证)。
ReportParameter[] parameters;
const string historyId = null;
const bool forRendering = true;
ParameterValue[] values = null;
DataSourceCredentials[] credentials = new DataSourceCredentials[] {};
ReportingService2005SoapClient c = new ReportingService2005SoapClient();
c.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("USERNAME", "PASSWORD", "DOMAIN");
c.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
c.GetReportParameters
(
"/CycleStatus/Builds Score",
historyId,
forRendering,
values,
credentials,
out parameters
);
然而,我通过以下误差的困扰:
“该HTTP请求是未经授权的客户端身份验证方案‘匿名’从服务器接收到的认证标头是‘协商,NTLM’”
要处理,你需要改变,在你的app.config安全节点,就像这样:
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
在那之后,一切运行良好。