WebServiceCredentials Object

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

Description

The WebServiceCredentials object provides a program interface to client and service credentials as well as service credential authentication settings for the web service that will be tested with the Web Service project element.

You obtain the WebServiceCredentials object in scripts through the Credentials property of the WebService object.

The WebServiceCredentials object provides a scripting interface to credentials of the web service under test. It contains three properties that help you configure the credential object or certificate that the client uses to authenticate itself to the service.

Members

Example

The following example demonstrates how to obtain the tested web service’s credentials object in script.

JavaScript, JScript

function WebServiceDemo()
{

  var MyWebService, Crd;

  // Obtain the web service under test
  MyWebService = WebServices.SampleWebService;
  // Call the web service's Credentials property
  Crd = MyWebService.Credentials;

}

Python

def WebServiceDemo():
  # Obtain the web service under test 
  MyWebService = WebServices.SampleWebService
  # Call the web service's Credentials property 
  Crd = MyWebService.Credentials

VBScript

Sub WebServiceDemo

  Dim MyWebService, Crd

  ' Obtain the web service under test
  Set MyWebService = WebServices.SampleWebService
  ' Call the web service's Credentials property
  Set Crd = MyWebService.Credentials

End Sub

DelphiScript

procedure WebServiceDemo();
var
  MyWebService, Crd;

begin

  // Obtain the web service under test
  MyWebService := WebServices.SampleWebService;
  // Call the web service's Credentials property
  Crd := MyWebService.Credentials;

end;

C++Script, C#Script

function WebServiceDemo()
{

  var MyWebService, Crd;

  // Obtain the web service under test
  MyWebService = WebServices["SampleWebService"];
  // Call the web service's Credentials property
  Crd = MyWebService["Credentials"];

}

See Also

WebService Object
Testing Web Services
Testing Web Services - Overview
About Web Service Checkpoints

Highlight search results