Namespace for ReportingService Class

混江龙づ霸主 提交于 2019-12-04 03:47:56

问题


I can't seem to find a clear answer as to how to import the proper namespace for ReportingService http://msdn.microsoft.com/en-us/library/aa258073(v=SQL.80).aspx.

I tried to follow the instruction here http://msdn.microsoft.com/en-us/library/aa237438(v=sql.80).aspx but there is no Add Web Service option showing when I create a console application.

There is a service account. Should I just use that instead?


回答1:


you have a full example on how to do this from a Console Application in MSDN, here: ReportExecutionService.Render Method which also requires you to read this one: http://msdn.microsoft.com/en-us/library/ms160695.aspx

in general if you create a .NET 4 Console App you can right click on References in Solution Explorer and select Add Service Reference, it works also with Web Services, not only for WCF.

For a Report Server running SSRS 2005 or 2008 the web service to reference has this form:

http://myserver/reportserver/ReportExecution2005.asmx

scroll the pages I linked above to find the console application example starting like this...

static void Main(string[] args)
{
  ReportExecutionService rs = new ReportExecutionService();
  rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
  rs.Url = "http://myserver/reportserver/ReportExecution2005.asmx";
  ...
  ...



回答2:


Just right click on your project item and select "Add Service Reference"

As an alternative solution you can generate the code with the wsdl.exe tool, it is generally what I do for SSRS.

For example from the VS command prompt:

wsdl /language:CS /n:"Microsoft.SqlServer.ReportingServices2010" http://<Server Name>/reportserver/reportservice2010.asmx?wsdl

More details on how to create the Web Service Proxy for SSRS.



来源:https://stackoverflow.com/questions/7922425/namespace-for-reportingservice-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!