> For the complete documentation index, see [llms.txt](https://docs.oneweb.tech/oneweb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oneweb.tech/oneweb/design-and-develop-oneweb-apps/design-and-develop-process/process-components/process-activity/web-service-task.md).

# Web Service Task

Use the **Web Service task** to call a Rest API or a Soap Service.

![](https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FYaUWwU3L7ytfbrad7TdU%2F0?alt=media)

### **Purpose**

**Web Service task** is used to call external web services using Rest API or Soap Web Service.

### Web Service Node Configuration Properties:

Web Service Task Configuration panel have 4 tabs to define properties.

#### **General**

General Tab contains general information such as title, task id, description etc.

#### **Business Object**

Used to configure and map the **Business Object** for input and output for the node.

### **Web Service Parameter**

![](https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FMUCrko10W8v8SRa5V3k5%2F1?alt=media)

<table data-header-hidden><thead><tr><th width="200"></th><th width="120"></th><th width="100"></th><th></th></tr></thead><tbody><tr><td><strong>Property</strong></td><td><strong>Mandatory</strong></td><td><strong>Default</strong></td><td><strong>Description</strong></td></tr><tr><td>Web Service Type</td><td>Yes</td><td>SOAP</td><td>To choose the type of web service. There are 2 types as following: SOAP and REST.</td></tr></tbody></table>

The values for **Setting** are as follows.

**SOAP**

When **SOAP** is selected as **Web Service Type**, user must enter the information about calling the Soap Service in the **SOAP** panel.

![](https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FgVeVjF3ZUrqlHBfar5zE%2F2?alt=media)

<table data-header-hidden><thead><tr><th width="160"></th><th width="120"></th><th width="125"></th><th></th></tr></thead><tbody><tr><td><strong>Property</strong></td><td><strong>Mandatory</strong></td><td><strong>Default</strong></td><td><strong>Description</strong></td></tr><tr><td>Source Type</td><td>Y</td><td>Url</td><td>User can choose to get WSDL definition from URL or File</td></tr><tr><td>use environment</td><td>N</td><td>Unchecked</td><td>If user chooses use environment checkbox, then system will display the list of environment variables for user to choose. User can set the WSDL URL in the environment variable setup screen and choose the variable in the configuration panel.</td></tr><tr><td>WSDL URL</td><td>Y, when SOAP using URL.</td><td></td><td>If user chooses Url as Source Type, WSDL URL is the URL to the WSDL File location. If user chooses use environment then select the environment variable corresponding to WSDL URL.</td></tr><tr><td>WSDL File</td><td>Y, SOAP using WSDL File</td><td></td><td>If user chooses File as Source Type, WSDL File for Web Service to be called.</td></tr><tr><td>XSD File</td><td>N</td><td></td><td>If user chooses File as Source Type, Subject of WSDL file.</td></tr><tr><td>Operation</td><td>Y</td><td></td><td>The operation is method to be called of that service.</td></tr><tr><td>End Point</td><td>Y</td><td></td><td>The endpoint is the URL where that service can be accessed by a client application.</td></tr><tr><td>Authentication</td><td>N</td><td></td><td>Authentication credentials for HTTP authentication.</td></tr><tr><td>Username</td><td>N</td><td></td><td>Username for Authentication. If user chooses use environment then select the environment variable corresponding to username.</td></tr><tr><td>Password</td><td>N</td><td></td><td>Password for Authentication. If user chooses use environment then select the environment variable corresponding to password.</td></tr></tbody></table>

**SOAP** panel has a **"Choose WSDL"** button to upload WSDL file or a **"Choose XSD"** button to upload XSD file. Once the user chooses a WSDL or XSD, user can click the **Get Operation** button to get all possible operations from the SOAP service. **Get Endpoint** button is to get End Point from SOAP Service.

**REST**

When **REST** is selected as the **Web Service Type**, user must enter information about calling the Rest API on **REST** panel.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2F4AsIn2pTCWqrIqaNFRey%2Fimage.png?alt=media&amp;token=816b7e52-ed9b-4574-b756-b82e24cca6a5" alt=""><figcaption></figcaption></figure>

<table data-header-hidden><thead><tr><th width="147"></th><th width="120"></th><th width="122"></th><th></th></tr></thead><tbody><tr><td><strong>Property</strong></td><td><strong>Mandatory</strong></td><td><strong>Default</strong></td><td><strong>Description</strong></td></tr><tr><td>use environment</td><td>N</td><td>Unchecked</td><td>If user chooses use environment checkbox, then system will display the list of   for user to choose. User can set the REST URL in the environment variable setup screen and choose the variable in the configuration panel.</td></tr><tr><td>REST URL</td><td>Y</td><td></td><td>URL for calling Rest API. If user chooses use environment then select the environment variable corresponding to REST URL.</td></tr><tr><td>Http Type</td><td>Y</td><td></td><td>Operations to HTTP requests.</td></tr><tr><td>Accept Header</td><td>Y</td><td></td><td>Type of text that the Rest API accepts.</td></tr><tr><td>Content Type</td><td>Y</td><td></td><td>A Content Type is a set of text response when calling Rest API.</td></tr><tr><td>Authentication</td><td>N</td><td></td><td>Authentication credentials for HTTP authentication. User can choose between Basic &#x26; IAM2</td></tr><tr><td>Username</td><td>N</td><td></td><td>If user chooses Authentication as <strong>Basic</strong>, Username for Authentication.</td></tr><tr><td>Password</td><td>N</td><td></td><td>If user chooses Authentication as <strong>Basic</strong>, Password for Authentication.</td></tr><tr><td>Header - Key</td><td>N</td><td></td><td>Additional header information key.If user chooses use environment then select the environment variable corresponding to KEY.</td></tr><tr><td>Header - Value</td><td>N</td><td></td><td>Additional header information value. If user chooses use environment then select the environment variable corresponding to Value.</td></tr></tbody></table>

**Add Row** button is used to add more header key value to the REST service. Trash icon ![](https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2Fm6Kz1D7eUE7tLU3qQ4b9%2Fimage.png?alt=media\&token=debc9ae5-0b5c-497c-a913-51a987ffb0d0) on right side is to remove any existing header rows.

Both SOAP and REST tabs contain an **"Open Mapping Parameter"** button. Clicking on "Open Mapping parameter" button redirects user to Mapping Parameter screen where user can click on **Mapping Parameter Input** line or **Mapping Parameter Output** line to map parameters for this **Web Service** task.

You can map the input parameter and output parameter of **SOAP** service using XPath mapping. Please refer below example of sample wsdl.

<div align="left"><figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2F185S7GS2w0WkJzNOEbVX%2Fimage.png?alt=media&amp;token=da73bf54-d239-44e9-a27c-81d60d4c724e" alt=""><figcaption></figcaption></figure></div>

Now to map the xpath for each input parameter.

<div align="left"><figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2Fm6GZiLBgjt9KJDGuHPfQ%2Fimage.png?alt=media&amp;token=eb58e6ef-73a6-4cae-9cb7-fed305d198cc" alt=""><figcaption></figcaption></figure></div>

For field name **"title"** you have to create xpath for mapping parameter as follows.

**Method 1:**

Parameter Name : title

XPath : /Operation\_in/book/title

Parameter Type : String

**Method 2:**

Parameter Name : title

XPath : //book/title

Parameter Type : String

**Method 3:**

Parameter Name : title

XPath : //title

Parameter Type : String

**XPath Syntax expression**

| Expression       | Description                                                                                            |
| ---------------- | ------------------------------------------------------------------------------------------------------ |
| nodename         | Selects all nodes with the name “nodename“.                                                            |
| /                | Selects from the root node.                                                                            |
| //               | Selects nodes in the document from the current node that match the selection no matter where they are. |
| .                | Selects the current node.                                                                              |
| ..               | Selects the parent of the current node.                                                                |
| @                | Selects attributes.                                                                                    |
| nodename\[index] | Selects the index of element.                                                                          |
