다음을 통해 공유


GetDataSourceContents 메서드

데이터 원본의 내용을 반환합니다.

네임스페이스:  ReportService2010
어셈블리:  ReportService2010(ReportService2010.dll)

구문

‘선언
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetDataSourceContents", RequestNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    ResponseNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
Public Function GetDataSourceContents ( _
    DataSource As String _
) As DataSourceDefinition
‘사용 방법
Dim instance As ReportingService2010
Dim DataSource As String
Dim returnValue As DataSourceDefinition

returnValue = instance.GetDataSourceContents(DataSource)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetDataSourceContents", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://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
)
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetDataSourceContents", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
public:
DataSourceDefinition^ GetDataSourceContents(
    String^ DataSource
)
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetDataSourceContents", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
member GetDataSourceContents : 
        DataSource:string -> DataSourceDefinition 
public function GetDataSourceContents(
    DataSource : String
) : DataSourceDefinition

매개 변수

  • DataSource
    유형: System. . :: . .String
    파일 이름과 .rsds 또는 .odc 파일 이름 확장명을 포함하는 데이터 원본의 정규화된 URL입니다.

반환 값

유형: ReportService2010. . :: . .DataSourceDefinition
데이터 원본에 대한 연결 속성을 포함하는 DataSourceDefinition 개체입니다.

주의

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());
        }
    }
}
Imports System
Imports System.IO
Imports System.Text
Imports System.Web.Services
Imports System.Web.Services.Protocols

Class Sample

    Public Shared Sub Main()

        Dim rs As New ReportingService2010()
        rs.Url = "http://<Server Name>" + _
            "/_vti_bin/ReportServer/ReportService2010.asmx"
        rs.Credentials = _
            System.Net.CredentialCache.DefaultCredentials

        Dim definition As DataSourceDefinition = Nothing

        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 e As SoapException
            Console.WriteLine(e.Detail.InnerXml.ToString())
        End Try

    End Sub

End Class