Export (0) Print
Expand All
Expand Minimize

ReportingService2010.GetDataSourceContents Method

Returns the contents of a data source.

Namespace:  ReportService2010
Assembly:  ReportService2010 (in ReportService2010.dll)

[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetDataSourceContents", RequestNamespace = "http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
	ResponseNamespace = "http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("TrustedUserHeaderValue")]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
public DataSourceDefinition GetDataSourceContents(
	string DataSource
)

Parameters

DataSource
Type: String
The fully qualified URL of the data source including the file name and .rsds or .odc file name extension.

Return Value

Type: ReportService2010.DataSourceDefinition
A DataSourceDefinition object that contains the connection properties for the data source. The Password field is not retrieved from the server and this property of the DataSourceDefinition object is always set to null.

The table below shows header and permissions information on this operation.

SOAP Header Usage

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

Native Mode Required Permissions

ReadContent

SharePoint Mode Required Permissions

OpenItems

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

class Sample
{
    static void Main(string[] args)
    {
        ReportingService2010 rs = new ReportingService2010();
        rs.Url = "http://<Server Name>" +
            "/_vti_bin/ReportServer/ReportService2010.asmx";
        rs.Credentials = 
            System.Net.CredentialCache.DefaultCredentials;

        DataSourceDefinition definition = null;

        try
        {
            definition = rs.GetDataSourceContents(
                "http://<Server Name>/Docs/Documents/" +
                "Data Sources/AdventureWorks.rsds");
            Console.WriteLine("Connection String: {0}", 
                definition.ConnectString);
            Console.WriteLine("Extension name: {0}", 
                definition.Extension);
        }

        catch (SoapException e)
        {
            Console.WriteLine(e.Detail.InnerXml.ToString());
        }
    }
}
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft