WebServices Object

Applies to TestComplete 15.63, last modified on April 23, 2024
Testing web services with TestComplete is obsolete. We recommend that you use ReadyAPI, another SmartBear's automated testing tool for SOAP and REST web services.
If needed, you can run ReadyAPI tests from TestComplete.

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

About Testing Web Services
About Testing Web Services
About Web Service Checkpoints

Highlight search results