Creating a Web Service Connection

To create a SOAP or REST Web Service Connection, navigate to the Connections tab of the Testing Settings view and click the New icon:

Give the Connection a name then select Connection Type: ‘Generic Web Service’. Select a sub-type of ‘Rest Web Service’ or ‘Soap Web Service’.

If you are setting up a REST Connection, move on to the next section, or if you are setting up a SOAP Connection, skip ahead to SOAP Connections.

REST Connections

There are six types of REST Connection available (as of version 1.9.7 and later):

  1. No Authentication: This is a curated list of APIs which do not require usernames, passwords, access tokens, signing, accept-headers, or anything more complicated than putting a URL in a browser.
  2. Basic Authentication: In the context of an HTTP transaction, basic access authentication is a method for an HTTP user agent to provide a user name and password when making a request.
  3. Api Key: To be used in cases where the user needs an API Key to process a REST request
  4. Oauth(Client Credentials): This is one of 2 Oauth flows for processing a REST request. In this scenario, the user will need a URL, along with a Client Id and Client Secret, to process the request.
  5. Oauth (Password): This is one of 2 Oauth flows for processing a REST Request. In this scenario, the user will need the above details (URL, Client Id and Client Secret) in addition to Username, Password and Authorize URL, to process the request.
  6. AWS Authentication (Provar version 1.9.7 and later): For AWS Authentication using AWS Signature Version 4. In this scenario the user will need a URL, along with an Access Key, Secret Key, AWS Region and Service Name.

Click on the relevant REST Connection Type above and follow the steps in the relevant section.

1. No Authentication REST Connection

For a No Authentication Connection, we just need to provide the basic domain URL, for example http://services.groupkt.com.

Once the Connection is saved, it will appear as follows:

Refer to Invoking the Connection for more information on using this Connection in a Test Case.

2. Basic Authentication REST Connection

For a Basic Authentication Connection, we need to provide the Resource URL with a Username and Password.

Once the Connection is saved, it will appear as follows:

Refer to Invoking the Connection for more information on using this Connection in a Test Case.

3. API Key REST Connection

For an API Key Connection, we need to provide the Resource URL and the API Key.

Once the Connection is saved, it will appear as follows:

Refer to Invoking the Connection for more information on using this Connection in a Test Case.

4. OAuth (Client Credentials) REST Connection

For an OAuth (Client Credentials) Connection, we need to provide the Resource URL, Client Id and Client Secret.

For Internal (Salesforce) APIs, you can find the Client Id and Client Secret via Setup > Build > Apps.

For example:

Once the Connection is saved, it will appear as follows:

Refer to Invoking the Connection for more information on using this Connection in a Test Case.

5. OAuth (Password) REST Connection

For an OAuth (Password) Connection, we need to provide the Resource URL with Client Id, Client Secret, User, Password and Authorized URL.

 

Once the Connection is saved, it will appear as follows:

Move on to Invoking the Connection for more information on using this Connection in a Test Case.

6. AWS Authentication Connection using AWS Signature Version 4 (Provar versions 1.9.7 and later)

For an AWS Authentication, we need to provide the URL, Access Key, Secret Key, AWS Region and Service Name. (Note that this option is available in Provar versions 1.9.7 and later).

For example:

Once the Connection is saved, it will appear as follows:

Refer to Invoking the Connection for more information on using this Connection in a Test Case.

SOAP Connections

For a SOAP Web Service Connection, we need to provide the WSDL location. The WSDL is defined at the SOAP Connection level so that it doesn’t need to be referenced continuously throughout the Test Case.

To locate the WSDL for the Web Service, log into Salesforce then choose Setup > Develop > Apex Classes.

Locate the correct Apex Class and right-click on the ‘WSDL’ link. Choose ‘Save link as’ to download the xml file.

Save the downloaded xml file in the wsdl directory inside your Provar project (you may need to create this directory in Provar if it doesn’t already exist):

Note that it is recommended but not mandatory to store the WSDL in the Provar Project. If there is a good reason to store it elsewhere, it can still be referenced in the same way in the Wsdl Location.

Then define the Wsdl Location in the SOAP Connection. This can be done using a relative path or an absolute path, as below:

Once the Connection is saved, it will appear as follows:

Move on to Web Services Testing for more information on using this Connection in a Test Case.