Método TestConnectForDataSourceDefinition
Testa a conexão de uma fonte de dados. Esse método oferece suporte aos testes diretos da fonte de dados.
Namespace: ReportService2010
Assembly: ReportService2010 (em ReportService2010.dll)
Sintaxe
'Declaração
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForDataSourceDefinition", 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 TestConnectForDataSourceDefinition ( _
DataSourceDefinition As DataSourceDefinition, _
UserName As String, _
Password As String, _
<OutAttribute> ByRef ConnectError As String _
) As Boolean
'Uso
Dim instance As ReportingService2010
Dim DataSourceDefinition As DataSourceDefinition
Dim UserName As String
Dim Password As String
Dim ConnectError As String
Dim returnValue As Boolean
returnValue = instance.TestConnectForDataSourceDefinition(DataSourceDefinition, _
UserName, Password, ConnectError)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForDataSourceDefinition", 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 bool TestConnectForDataSourceDefinition(
DataSourceDefinition DataSourceDefinition,
string UserName,
string Password,
out string ConnectError
)
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForDataSourceDefinition", 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:
bool TestConnectForDataSourceDefinition(
DataSourceDefinition^ DataSourceDefinition,
String^ UserName,
String^ Password,
[OutAttribute] String^% ConnectError
)
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForDataSourceDefinition", 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 TestConnectForDataSourceDefinition :
DataSourceDefinition:DataSourceDefinition *
UserName:string *
Password:string *
ConnectError:string byref -> bool
public function TestConnectForDataSourceDefinition(
DataSourceDefinition : DataSourceDefinition,
UserName : String,
Password : String,
ConnectError : String
) : boolean
Parâmetros
- DataSourceDefinition
Tipo: ReportService2010. . :: . .DataSourceDefinition
A definição de fonte de dados que define a conexão à fonte de dados.
- 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
Um valor booliano indica se a conexão foi concluída com êxito.
Uma cadeia de caracteres que contém uma mensagem de erro detalhada. A cadeia de caracteres é retornada como o parâmetro out ConnectError.
Comentários
The table below shows header and permissions information on this operation.
SOAP Header Usage |
(Out) ServerInfoHeaderValue |
Native Mode Required Permissions |
ExecuteReportDefinition (System) |
SharePoint Mode Required Permissions |
Needs the system property EnableLoadReportDefinition set to true |
Permission to execute the report definition is required.