Today I am going to write about how to access SQL Server Report Server through Report Server Web service. You can access all the full functionality of the report server through this Report Server Web service. The Report Server Web service is an XML Web service with a SOAP API. It uses SOAP over HTTP and acts as a communications interface between client programs and the report server.

The Microsoft SQL Server 2008R2 Report Server Web service provides two endpoints, one is for report management and the other one is for report execution.
  1. ReportService2010
    • The ReportService2010 endpoint contains methods for managing objects in a Report Server in either native or SharePoint integrated mode. The WSDL for this endpoint is accessed through  http://server/reportserver/ReportService2010.asmx?wsdl.
  2. ReportExecution2005
    • The ReportExecution2005 endpoint allows developers to programmatically process and render reports in a Report Server. The WSDL for this endpoint is accessed through  http://server/reportserver/ReportExecution2005.asmx?wsdl.
Previous versions of Microsoft SQL Servers' has several versions of Report Server Web service endpoints. For example ReportService2005 and ReportService2006. But ReportService2005 andReportService2006 endpoints are deprecated in SQL Server 2008 R2. The ReportService2010 endpoint includes the functionalities of both endpoints and contains additional management features.

Now, I will move into how to access Report Server using Report Server Web Service. I have created sample web site and in the Default.aspx page I have put a single button. First what I would do is, I will add a Service Reference to Report Server Web Service and the endpoint I am going to use is ReportService2010.

I will right click on my Web Site Project and will click on Add Service Reference.

Add Service Reference

In here, I have put http://server/reportserver/ReportService2010.asmx as address, I did not add ?wsdl to the end of the address, because both are valid formats.

Now if you observe the Web.config file, you will see that following part is added.

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ReportingService2010Soap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://server/ReportServer/ReportService2010.asmx" binding="basicHttpBinding" bindingConfiguration="ReportingService2010Soap" contract="ReportService2010.ReportingService2010Soap" name="ReportingService2010Soap"/>
</client>
</system.serviceModel>

Now in my button click event I am writing following code.

using System.Net;
using ReportService2010; protected void btnListChildren_Click(object sender, EventArgs e)
{
NetworkCredential clientCredentials = new NetworkCredential("username", "password", "domain");
ReportService2010.ReportingService2010SoapClient client = new ReportService2010.ReportingService2010SoapClient();
client.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
client.ClientCredentials.Windows.ClientCredential = clientCredentials;
client.Open();
TrustedUserHeader t = new TrustedUserHeader();
CatalogItem[] items;
// I need to list of children of a specified folder.
ServerInfoHeader oServerInfoHeader = client.ListChildren(t, "/", true, out items);
foreach (var item in items)
{
// I can access any properties of item
}
}
Now again in my Web.config file I need to do some modifications. If not I might get this type of error when I am executing my button click event.
 
Request is unauthorized.
I am modifying the Web.config file as follows.
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
 

That's all. Now when I run the Web Site I can get the list of children in the parent folder through the Report Server Web Service. Through this Web Service we can access all the full functionality of the report server. Isn't it great.

Happy Coding.

Regards,
Jaliya

 

Accessing Report Server using Report Server Web Service - Microsoft SQL Server 2008R2的更多相关文章

  1. P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1

    P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1       May ...

  2. Microsoft SQL Server Version List(SQL Server 版本)

    原帖地址 What version of SQL Server do I have? This unofficial build chart lists all of the known Servic ...

  3. 从 Microsoft SQL Server 迁移到 Oracle

    来源于:http://www.oracle.com/technetwork/cn/database/migration/sqlserver-095136-zhs.html Oracle SQL Dev ...

  4. Zabbix template for Microsoft SQL Server总结

      Zabbix template for Microsoft SQL Server介绍   这里介绍Zabbix下监控Microsoft SQL Server数据库非常好用的一个模板,模板名为&qu ...

  5. 未能加载包“Microsoft SQL Server Data Tools”

    直接在vs2013里的App_Data目录创建数据库,在服务器资源管理器中查看时报错: 未能加载包“Microsoft SQL Server Data Tools” 英文: The 'Microsof ...

  6. Microsoft SQL Server JDBC 驱动程序支持矩阵

    本页包含 Microsoft SQL Server JDBC 驱动程序的支持矩阵和支持生命周期策略. Microsoft JDBC 驱动程序支持生命周期矩阵和策略 Microsoft 支持生命周期 ( ...

  7. [转]Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录

    本文转自:https://www.cnblogs.com/Zouzhe/p/5736070.html SQL SERVER 2008 R2 是微软目前最新的数据库版本,在之前的SQL SERVER 2 ...

  8. Microsoft SQL SERVER 2008 R2 REPORT SERVICE 匿名登录

    SQL SERVER 2008 R2 是微软目前最新的数据库版本,在之前的SQL SERVER 2005中,我们可以通过修改IIS对应的SSRS站点及SSRS的配置文件,将SSRS配置成匿名登录的方式 ...

  9. Python接口测试实战5(下) - RESTful、Web Service及Mock Server

    如有任何学习问题,可以添加作者微信:lockingfree 课程目录 Python接口测试实战1(上)- 接口测试理论 Python接口测试实战1(下)- 接口测试工具的使用 Python接口测试实战 ...

随机推荐

  1. 函数:module_put ( )【转】

    转自:http://book.2cto.com/201307/27049.html 文件包含: #include <linux/module.h> 函数定义: 函数在内核源码中的位置:li ...

  2. mvn常用的构建命令

    mvn -v 查看maven版本 mvn compile 编译 mvn test 测试 mvn package 打包 mvn clean 删除target mvn install 安装jar包到本地仓 ...

  3. c++文件流写入到execl中

    #include <iostream> #include <fstream> #include <string> using namespace std; int ...

  4. [ 手记 ] LNMP安装过程及优化

    环境:CentOS release 6.4 x64 1.配置防火墙: 上一篇博客已经写过:http://www.cnblogs.com/hukey/p/5300832.html 2.修改sysctl. ...

  5. 【C++】多重继承

    1. 多重继承时的二义性 当使用多重继承时,如果多个父类都定义了相同名字的变量,则会出现二义性.解决方法:使用 :: 声明作用域 #include <iostream> using nam ...

  6. yum,httpd,php环境搭建方法

    #删除已有的yum 1  rpm -qa|grep yum|xargs rpm -e --nodeps 2  ls 3  rpm -ivh python-iniparse-0.3.1-2.1.el6. ...

  7. Java语言中的协变和逆变(zz)

    转载声明: 本文转载至:http://swiftlet.net/archives/1950 协变和逆变指的是宽类型和窄类型在某种情况下的替换或交换的特性.简单的说,协变就是用一个窄类型替代宽类型,而逆 ...

  8. css样式表中的样式覆盖顺序(转)

    有时候在写CSS的过程中,某些限制总是不起作用,这就涉及了CSS样式覆盖的问题,如下 Css代码   #navigator { height: 100%; width: 200; position:  ...

  9. WebDriver框架之自动运行失败的case

    大家在运行自动化case的时候都会碰到失败的情况,有的时候可能是被测程序有bug,还有就是网络的问题,如果想采取失败的case再运行一次的机制,那么有bug的情况,即使再运行N次还是失败,那么如果是网 ...

  10. [bootstrap] 修改字体

    file: variable.less @font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-seri ...