# Web Service Task

Use the **Web Service Task** to integrate with **external web services**, including both **REST APIs** and **SOAP services**, as part of a Microflow or Process Flow.

The Web Service Task enables applications to consume external services through **visual configuration**, eliminating the need to manually write service‑calling code.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FLTBaDnYf0jZOqcHCZxuA%2Fimage.png?alt=media&#x26;token=1ab579b5-7625-4471-b679-7542f51d9eed" alt=""><figcaption></figcaption></figure>

***

### Purpose

The **Web Service Task** is used to:

* Call **REST APIs** or **SOAP web services**
* Exchange data with external systems
* Integrate ONEWEB applications into service‑oriented architectures

This task is a core integration component for system‑to‑system communication.

***

### Web Service Task Configuration

The **Web Service Task configuration panel** consists of **four tabs**, each responsible for a different aspect of the service definition.

***

#### General Tab

The **General** tab contains metadata and descriptive information:

* Task name
* Task ID (system‑generated)
* Description

This information helps identify the task within the flow.

***

#### Business Object Tab

The **Business Object** tab is used to:

* Define **input Business Objects**
* Define **output Business Objects**

Business Objects represent the data contract between the Microflow and the external service.

***

#### Web Service Parameter Tab

The **Web Service Parameter** tab allows users to choose the **type of web service** to be consumed.

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

| Property         | Mandatory | Default | Description                                       |
| ---------------- | --------- | ------- | ------------------------------------------------- |
| Web Service Type | Yes       | SOAP    | Choose the web service type: **SOAP** or **REST** |

***

### SOAP Web Service Configuration

When **SOAP** is selected as the Web Service Type, users must configure service details in the **SOAP panel**.

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

#### SOAP Configuration Properties

| Property            | Mandatory   | Description                                 |
| ------------------- | ----------- | ------------------------------------------- |
| Source Type         | Yes         | Load WSDL from **URL** or **File**          |
| Use Environment     | No          | Use environment variable for WSDL URL       |
| WSDL URL            | Conditional | URL of the WSDL file                        |
| WSDL File           | Conditional | Upload local WSDL file                      |
| XSD File            | No          | Upload XSD file if required                 |
| Operation           | Yes         | SOAP operation to invoke                    |
| End Point           | Yes         | Service endpoint URL                        |
| Authentication      | No          | HTTP authentication settings                |
| Username / Password | No          | Credentials (can use environment variables) |

#### SOAP Helper Actions

* **Choose WSDL** – upload WSDL file
* **Choose XSD** – upload XSD file
* **Get Operation** – retrieve available service operations
* **Get Endpoint** – load endpoint from WSDL

***

### REST API Configuration

When **REST** is selected, service configuration is performed in the **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&#x26;token=816b7e52-ed9b-4574-b756-b82e24cca6a5" alt=""><figcaption></figcaption></figure>

#### REST Configuration Properties

| Property            | Mandatory | Description                                |
| ------------------- | --------- | ------------------------------------------ |
| Use Environment     | No        | Use environment variable for REST URL      |
| REST URL            | Yes       | Endpoint URL                               |
| HTTP Type           | Yes       | HTTP method (GET, POST, PUT, DELETE, etc.) |
| Accept Header       | Yes       | Response format (e.g. application/json)    |
| Content Type        | Yes       | Request format                             |
| Authentication      | No        | Basic or IAM2 authentication               |
| Username / Password | No        | Used when authentication is Basic          |
| Header Key / Value  | No        | Add custom HTTP headers                    |

* **Add Row** – add multiple custom headers
* **Trash icon** – remove header entries

***

### Parameter Mapping (Input & Output)

Both **SOAP** and **REST** configurations provide an **Open Mapping Parameter** button.

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

* Map **input parameters** to service requests
* Map **output parameters** from service responses

***

### SOAP XPath Mapping

For **SOAP services**, parameters are mapped using **XPath expressions**.

#### Example XPath Mapping for field `title`

**Method 1**

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

**Method 2**

```
 //book/title
```

**Method 3**

```
 //title
```

Parameter type: `String`

#### Common XPath Syntax

| Expression       | Description                          |
| ---------------- | ------------------------------------ |
| nodename         | Select nodes with the given name     |
| /                | Select from root node                |
| //               | Select nodes regardless of hierarchy |
| .                | Current node                         |
| ..               | Parent node                          |
| @                | Attribute                            |
| nodename\[index] | Select element by index              |

XPath mapping allows precise extraction of data from SOAP responses.

***

### Summary

The **Web Service Task** is a powerful integration node in ONEWEB, enabling applications to consume both **REST** and **SOAP** services through visual configuration.

Using Web Service Task, applications can:

* Integrate with external systems reliably
* Configure services without writing code
* Support SOAP and REST with a unified approach
* Map request and response data visually
* Leverage environment variables for deployment portability

Web Service Task is a foundational component for building **service‑oriented and enterprise‑grade integrations** in ONEWEB.


---

# 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/building-apps/integrations/develop-integration-with-oneweb-microflow/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.
