Compartilhar via


Método TestConnectForItemDataSource

Testa a conexão de uma fonte de dados. Esse método dá suporte aos testes de fontes de dados publicadas usadas por relatórios ou modelos e fontes de dados compartilhadas. Esse método se aplica aos tipos de item Report, Model e Dataset.

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

Sintaxe

'Declaração
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForItemDataSource", 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("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
Public Function TestConnectForItemDataSource ( _
    ItemPath As String, _
    DataSourceName As String, _
    UserName As String, _
    Password As String, _
    <OutAttribute> ByRef ConnectError As String _
) As Boolean
'Uso
Dim instance As ReportingService2010
Dim ItemPath As String
Dim DataSourceName As String
Dim UserName As String
Dim Password As String
Dim ConnectError As String
Dim returnValue As Boolean

returnValue = instance.TestConnectForItemDataSource(ItemPath, _
    DataSourceName, UserName, Password, _
    ConnectError)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForItemDataSource", 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("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapHeaderAttribute("TrustedUserHeaderValue")]
public bool TestConnectForItemDataSource(
    string ItemPath,
    string DataSourceName,
    string UserName,
    string Password,
    out string ConnectError
)
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForItemDataSource", 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"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
public:
bool TestConnectForItemDataSource(
    String^ ItemPath, 
    String^ DataSourceName, 
    String^ UserName, 
    String^ Password, 
    [OutAttribute] String^% ConnectError
)
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForItemDataSource", 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("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
member TestConnectForItemDataSource : 
        ItemPath:string * 
        DataSourceName:string * 
        UserName:string * 
        Password:string * 
        ConnectError:string byref -> bool 
public function TestConnectForItemDataSource(
    ItemPath : String, 
    DataSourceName : String, 
    UserName : String, 
    Password : String, 
    ConnectError : String
) : boolean

Parâmetros

  • ItemPath
    Tipo: System. . :: . .String
    A URL totalmente qualificada do item ao qual DataSourceName se aplica, incluindo o nome do arquivo e a extensão no modo do SharePoint. O item pode ser uma fonte de dados compartilhada, um relatório ou um modelo de relatório.
  • UserName
    Tipo: System. . :: . .String
    O nome de usuário a ser usado para testar a conexão. UserName é usado com fontes de dados que solicitam credenciais.
  • Password
    Tipo: System. . :: . .String
    A senha a ser usada para testar a conexão. Password é usado com fontes de dados que solicitam credenciais.
  • ConnectError
    Tipo: System. . :: . .String%
    Uma mensagem de erro detalhada. A mensagem é retornada quando ocorre uma falha na conexão. O provedor da fonte de dados fornece a mensagem detalhada.

Valor de retorno

Tipo: System. . :: . .Boolean
Uma cadeia de caracteres que contém uma mensagem de erro detalhada. A cadeia de caracteres é retornada como o parâmetro out ConnectError.
Um valor booliano indica se a conexão foi concluída com êxito.

Comentários

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

SOAP Header Usage

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

Native Mode Required Permissions

Depends on the item type:

SharePoint Mode Required Permissions

Depends on the item type:

  • Report, DataSet: OpenItems()()()() on ItemPath

  • Report using a model or a shared datasource: OpenItems()()()() on DataSourceName

  • DataSource: OpenItems()()()()

  • Model: OpenItems()()()()

If DataSourceName points to an XML data source, this method does nothing and returns true.