# Web Service Task

The **Web Service Task** is used to invoke **external web services** from within a business process.\
It supports both **SOAP Web Services** and **REST APIs**, allowing seamless system‑to‑system integration.

It is represented by a **rectangular BPMN activity node**, as shown below.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FyEo9VyFfDtq1NjfdXYys%2F0?alt=media" alt=""><figcaption></figcaption></figure>

***

### Purpose

The **Web Service Task** enables a process to:

* Call external systems
* Exchange data with third‑party services
* Integrate with enterprise and cloud APIs

It is commonly used for:

* Data synchronization
* Service orchestration
* External validation and enrichment
* Microservice integration

***

### Web Service Task Configuration Overview

The Web Service Task configuration panel contains **four main tabs**:

1. **General**
2. **Business Object**
3. **Web Service Parameter**
4. **Mapping Parameter**

Each tab controls a specific aspect of service invocation.

***

### General Tab

The **General** tab defines basic metadata for the Web Service Task, including:

* Task name
* Task ID
* Description

These properties help identify the task’s purpose within the process flow.

> **Important**\
> Always click **Save Panel** to persist configuration changes.

***

### Business Object Tab

The **Business Object** tab is used to configure and map:

* **Input parameters** sent to the web service
* **Output parameters** received from the web service

This mapping allows web service responses to be reused by downstream activities.

Business Object mapping is required whenever:

* Data is passed into the service
* Data returned from the service is used later in the process

***

### Web Service Parameter Tab

In this tab, users define **how the web service is called**.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2Fy66sAeT5tPxmce75CKje%2F1?alt=media" alt=""><figcaption></figcaption></figure>

#### Core Property

| Property         | Mandatory | Default | Description                        |
| ---------------- | --------- | ------- | ---------------------------------- |
| Web Service Type | Yes       | SOAP    | Web service protocol: SOAP or REST |

Depending on the selected type, either the **SOAP** or **REST** configuration panel will be displayed.

***

### SOAP Web Service Configuration

When **SOAP** is selected, users must configure the SOAP service details.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FeDwIgeYRwJXqJDaa0ePV%2F2?alt=media" alt=""><figcaption></figcaption></figure>

#### SOAP Properties Overview

* **Source Type**: URL or File
* **Use Environment**: Use environment variables for WSDL, credentials
* **WSDL URL / File**: Location of WSDL definition
* **XSD File** (optional)
* **Operation**: SOAP method to be invoked
* **Endpoint**: Service endpoint URL
* **Authentication**: HTTP authentication (optional)
* **Username / Password**: Credentials (supports environment variables)

#### SOAP Utilities

* **Choose WSDL** – Upload WSDL file
* **Choose XSD** – Upload XSD file
* **Get Operation** – Discover available SOAP operations
* **Get Endpoint** – Retrieve endpoint from WSDL

***

### REST API Configuration

When **REST** is selected, users must configure REST API parameters.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FYFMmJco7O5wWy8ZTFCn6%2F3?alt=media" alt=""><figcaption></figcaption></figure>

#### REST Properties Overview

* **Use Environment** – Load REST URL from environment variable
* **REST URL** – API endpoint
* **HTTP Type** – GET, POST, PUT, DELETE, etc.
* **Accept Header** – Expected response media type
* **Content Type** – Request payload type
* **Authentication** – Basic or IAM2
* **Username / Password** – For Basic authentication
* **Header (Key / Value)** – Additional request headers

Use **Add Row** to add multiple headers.\
Use the **Trash icon** ![](https://docs.oneweb.tech/oneweb/~gitbook/image?url=https%3A%2F%2F2015371994-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FMpDjHWFRUtZ5nJcSfVXd%252Fuploads%252FJHdwoDeNXgusQs51sijR%252F4%3Falt%3Dmedia\&width=300\&dpr=3\&quality=100\&sign=c485134e\&sv=2) to remove header rows.

***

### Mapping Parameters (SOAP & REST)

Both SOAP and REST support parameter mapping via **Open Mapping Parameter**.

Clicking this button opens the **Mapping Parameter screen**, where users can map:

* Process input → Web service input
* Web service output → Process output

***

### SOAP XPath Mapping Example

SOAP responses are mapped using **XPath expressions**.

Example WSDL structure:

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FCswBCcKB9Moz9kw6UtWi%2F5?alt=media" alt=""><figcaption></figcaption></figure>

XPath mapping example for field **title**:

**Method 1**

```
/Operation_in/book/title
```

**Method 2**

```
//book/title
```

**Method 3**

```
//title
```

All methods produce the same result, depending on XML structure.

***

### XPath Expression Reference

| Expression       | Description                        |
| ---------------- | ---------------------------------- |
| nodename         | Selects all nodes with that name   |
| /                | Selects from root node             |
| //               | Selects nodes anywhere in document |
| .                | Selects current node               |
| ..               | Selects parent node                |
| @                | Selects attributes                 |
| nodename\[index] | Selects element by index           |

***

### Summary

The **Web Service Task** enables powerful external integrations within ONEWEB processes.

Key features:

* Supports SOAP and REST
* Environment‑based configuration support
* Full input/output data mapping
* XPath‑based SOAP response handling
* Header, authentication, and security options

It is a core component for **enterprise‑grade integration and service orchestration** within Process Designer.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onewebstack.com/oneweb-platform-th/designer-reference/process-designer/process-designer-component/activity-nodes/web-service-task.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
