# Web Service Connector

The WebService Connector allows you to consume REST web services.

Do this:

* import the web service from an OpenAPI definition file, *or*
* use the Connection Editor to create the connection manually.

***

{% embed url="<https://www.youtube.com/embed/fVHZwNR0UZc?autoplay=1&rel=0&vq=1080>" %}
Add a Web Service Connector
{% endembed %}

***

### Connection Editor Properties

To add a Connector, click on the Connector button located on the toolbar, then select the *Web Service* option.

To create the web service connection manually, click the Create Web Service Manually button and provide the following details:

![](https://3514041584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqxH8JA8xG3I22tiZG5H6%2Fuploads%2Fgit-blob-78da1a1f12e689de16a33373e30112d147a71805%2Fwebservice-connection.png?alt=media)

1. **Base URL**

   This is the base URL of the web service.
2. **Timeout**

   This value corresponds to the duration in seconds before a request to the web service times out.
3. **Authentication**

Available options:

* *Anonymous*\
  \- For web services requiring no authentication.
* *Basic*\
  \- For web services requiring the HTTP basic method of authentication. Required: username and password.
* *Api Key*\
  \- For web services requiring authentication through an API key. Required: key name, key value and key location (QueryString/Header/Cookie).

5. *Note:* Stadium does not currently support authentication via OAuth2.

***

### Function Editor

To add a function, click on the relevant Connector's + sign:\
![](https://3514041584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqxH8JA8xG3I22tiZG5H6%2Fuploads%2Fgit-blob-a5cae291b575848522d8453450e98217ddf095c8%2Fadd-function-1.png?alt=media)

A function placeholder is created.

<div align="left"><img src="https://3514041584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqxH8JA8xG3I22tiZG5H6%2Fuploads%2Fgit-blob-279b34f97a24292d1a23312d93dd58ece5d91558%2Fadd-function-2.png?alt=media" alt=""></div>

Click on the function name to open the *Function Editor*:

\\

<figure><img src="https://3514041584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqxH8JA8xG3I22tiZG5H6%2Fuploads%2Fgit-blob-ac6c00679b849cfd0f6ddf05025a61f59b850312%2Fwebservice-function.png?alt=media" alt=""><figcaption></figcaption></figure>

1. **Method**

   Use this dropdown to select the HTTP method type of the web request.
2. **Path**

   The URL segment specifying the path and query string parameters of a web request is specified here. Use "{ }" to denote any path parameter having variable values. For example, the path "/pet/{petId}/?filter=cat" will create the path parameter "petId". Path parameters will appear in the Parameters table.
3. **Parameters**

   The Parameters table lists the parameters available to be read or set in page controls or *Scripts*. To add a new parameter, enter the parameter name and location (QueryString/Header/Cookie) into the last row of the Parameters table.
4. **Body Format**

   Use this dropdown to select the body content type of the web request. This property is enabled only when the HTTP Method is set to POST or PUT.

***

### Function Properties

1. **Response Format**

   Use this dropdown to select the content type of the response received from the web request.
