WebServices Object

Applies to TestComplete 14.30, last modified on November 21, 2019

Description

The WebServices object lets you work with web services added to the Web Services collection of your TestComplete project.

The Web Services collection and its items

The WebServices object provides access to individual web services added to the collection by their name as it is displayed in the Project Explorer panel:

WebServices.WebServiceItem_Name

In addition, the WebServices object has methods that let you get information about an arbitrary web service at run-time and work with SOAP requests and responses sent to and from that service.

Requirements

To be able to access the WebServices object in tests, you must have the Web Services collection added to your project. See Adding and Removing Project Items and Their Child Elements.

Members

Example

The following example shows how to use the WebServices object’s properties to obtain the tested web service in script and to call a method of the tested web service.

JavaScript, JScript

function Test()
{
  var str = WebServices.SampleWebService.HelloWorld();
  Log.Message(str);
}

Python

def Test():
  str = WebServices.SampleWebService.HelloWorld();
  Log.Message(str)

VBScript

Sub Test
  Dim str

  str = WebServices.SampleWebService.HelloWorld
  Log.Message Str
End Sub

DelphiScript

procedure Test;
var str;
begin
   str := WebServices.SampleWebService.HelloWorld;
   Log.Message(Str);
end;

C++Script, C#Script

function Test()
{
  var str = WebServices["SampleWebService"]["HelloWorld"]();
  Log.Message(str);
}

See Also

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

Highlight search results