Credentials Property

Applies to TestComplete 14.40, last modified on April 22, 2021

Description

Use this property to obtain access to client and service credentials as well as service credentials authentication settings for the web service.

Declaration

WebServiceObj.Credentials

Read-Only Property WebServiceCredentials object
WebServiceObj An expression, variable or parameter that specifies a reference to a WebService object

Applies To

The property is applied to the following object:

Property Value

The WebServiceCredentials object that assists you in specifying a certificate’s credentials.

Example

The following code defines the Windows credentials for the SampleWebService web service.

JavaScript, JScript

function Test()
{
  var service = WebServices.SampleWebService;

  var auth = service.Credentials.Windows;
  auth.AllowNtlm = true;
  auth.ClientCredentials.UserName = "Tester";
  auth.ClientCredentials.Domain = "QA";
  auth.ClientCredentials.Password = "123456";
}

Python

def Test():
  service = WebServices.SampleWebService;
  auth = service.Credentials.Windows;
  auth.AllowNtlm = True;
  auth.ClientCredentials.UserName = "Tester";
  auth.ClientCredentials.Domain = "QA";
  auth.ClientCredentials.Password = "123456";

VBScript

Sub Test
  Dim service, auth

  Set service = WebServices.SampleWebService

  Set auth = service.Credentials.Windows
  auth.AllowNtlm = True
  auth.ClientCredentials.UserName = "Tester"
  auth.ClientCredentials.Domain = "QA"
  auth.ClientCredentials.Password = "123456"
End Sub

DelphiScript

procedure Test;
var service, auth;
begin
  service := WebServices.SampleWebService;

  auth := service.Credentials.Windows;
  auth.AllowNtlm := true;
  auth.ClientCredentials.UserName := 'Tester';
  auth.ClientCredentials.Domain := 'QA';
  auth.ClientCredentials.Password := '123456';
end;

C++Script, C#Script

function Test()
{
  var service = WebServices["SampleWebService"];

  var auth = service["Credentials"]["Windows"];
  auth["AllowNtlm"] = true;
  auth["ClientCredentials"]["UserName"] = "Tester";
  auth["ClientCredentials"]["Domain"] = "QA";
  auth["ClientCredentials"]["Password"] = "123456";
}

See Also

WebServiceCredentials Object
Testing Web Services

Highlight search results