Component Web request to integration channel

Table of Contents

Description

Enables HTTP and HTTPS requests to web services configured in integration channels.
Supports HTTP methods GET, POST, PUT, HEAD, DELETE with and without content. Supports sending asynchronous requests and requests with pending responses.
In case of an error, the transition is made along the "Error" branch, and the corresponding code is returned to the "Error code" variable HTTP.
The component supports working in sessions, storing and using cookies, as well as HTTPS and certificate validation.

The actual sending of the request can be done either from the server on which the current script handler is running, or from the system’s edge servers «Incoplax».

To replace the component by executing a "curl" request via the command line (component Process Run), you must manually generate the URL by delivering the desired channel-integration (component Operation), and parse its contents.

Table 1. System Characteristics

Index

143

Short title

web_services

Types of scenarios

All of them

Starter module

r_script_component_web_services

Mode

Asynchronous

Icon

143

Branching pattern

Branching, closing

Properties

Table 2. Properties
Specification Description

Title: Proxy
Code: proxyMode
Visibility: no
Default: `No'

Proxy server usage switch.

Title: Authentication to Proxy
Code: proxyAuth
Visibility: yes
Default: `None'

Proxy authentication switch.

Title: Proxy Login
Code: proxyLogin
Visibility: yes
Default: — 

Login to proxy server.

Title: Proxy Password
Code: proxyPass
Visibility: yes
Default: — 

Password to proxy server.

Title: Proxy Address
Code: proxyAddr
Visibility: yes
Default: — 

Proxy server address.

Title: Proxy Port
Code: proxyPort
Visibility: yes
Default: — 

Proxy server port.

Title: Max. redirects
Code: maxRedirectCount
Visibility: no
Default: — 

Limit the maximum number of redirects. Value for HTTP header Max-Forwards.

Title: Integration Channel Source
Code: webserviceMode
Visibility: no
Default: From list

Method for selecting the integration channel through whose URL to send the HTTP request.
Value options:

  • From the list (list, 0)

  • By code (arg, 1)

URL for the query is

Title: Integration Channel
Code: webserviceCode
Visibility: no
Default: — 

Drop-down list with integration channel codes. Contains all available integration channels contained in the current domain.

Title: Integration Channel Code
Code: webserviceCodeArg
Visibility: no
Default: — 

An argument containing the code of the integration channel in the current domain.

Title: Page
Code: urlPage
Visibility: no
Default: — 

Argument containing page (endpoint).
The final URL for the request is generated based on the URL integration channel and the specified page.

Title: Source of Request
Code: reqSrc
Visibility: no
Default: — 

The address of the server from which to send the request.
By default, the request is sent from the server where the handler executes the script.
Possible indication formats:

  • NodeName

  • NodeName:Iface

  • NodeName@NodeAddr

  • NodeName@NodeAddr:Iface

  • RoleId

  • RoleId:Iface

  • RoleName

  • RoleName:Iface

where

  • NodeName – the short name of the node in its full name (abc002@192.168.0.12);

  • NodeAddr – node address in its full name;

  • RoleId – role identifier in the configuration, the node is defined by the role;

  • RoleName – name of the role in the configuration, the node is defined by the role;

  • Iface – address of the network interface on the server.

If there is no node/role, any incorrect name assignment, the dispatch is done from the server where the handler executes the script.

If the sender server network interface address is missing or incorrectly specified, sending will be done from the sender node address.

Title: Method
Code: method
Visibility: no
Default: GET

Possible options:

  • POST (post, 0)

  • GET (get, 1)

  • PUT (put, 2)

  • HEAD (head, 3)

  • DELETE (delete, 4)

  • PATCH (patch, 5)

  • TRACE (trace, 6)

  • OPTIONS (options, 7)

Title: Content Type
Code: contentType
Visibility: yes
Default: "application/x-www-form-urlencoded"

Value for HTTP header Content-Type.

Title: Request Body
Code: reqContentArg
Visibility: yes
Default: — 

HTTP request body content.

Title: Query Coding
Code: reqEncoding
Visibility: yes
Default: utf-8

The encoding used to convert the request body from string to binary before sending.
Possible options:

  • unicode (0)

  • utf-8 (1)

  • utf-7 (2)

  • cp1251 (3) – Code page windows-1251 (Cyrillic alphabet)

  • Specify name (byname, 4) - Specify the encoding name manually.

Title: Query Encoding Name
Code: reqEncodingName
Visibility: yes
Default: "cp1251"

The manually specified encoding name for the request body.

Title: Basic Authentication
Code: basicAuth
Visibility: no
Default: `None'

Basic Authentication Switch.

Title: Login
Code: bAuthLogin
Visibility: yes
Default: — 

Basic Authentication Login.

Title: Password
Code: bAuthPass
Visibility: yes
Default: — 

Password for basic authentication.

Title: Titles
Code: addHeaders
Visibility: no
Default: — 

Additional HTTP headers substituted in the request. The argument contains a multiline value, the format of each of the strings: HeaderName: HeaderValue.

Title: Cookie
Code: addCookies
Visibility: no
Default: — 

Additional COOKIEs substituted in the query. The argument contains a multiline value, the format of each of the strings: Key=Value.

Title: Mode
Code: mode
Visibility: no
Default: Waiting for result

Component operation mode after sending a request.
Possible options:

  • Waiting for Result (0) - Waiting for a response until the script completes.

  • Asynchronous start (1) - Control is immediately passed to the next component.

  • Timeout (2) - Waiting for a response for a specified time, after which the HTTP connection is terminated and control is passed to the next component.

  • Exit by timeout (3) - Waiting for a response for a specified time, after which time control is passed to the next component without breaking the connection and interrupting the sending process.

Title: Time, s
Code: timeoutSec
Visibility: yes
Default: — 

Timeout for waiting for a response to a sent HTTP request.

Title: Answer Code
Code: respCodeVariable
Visibility: yes
Default: — 

Variable to store the HTTP response code.

Not filled in if the request has not been answered.

If the request is completed with a 3xx response

a new forwarded request is initiated and the 3xx response code is further overwritten."

Title: Answer Headings
Code: respHeadVariable
Visibility: yes
Default: — 

Variable to store HTTP response headers.
Not filled in if the request has not been answered.
If the request is completed with a 3xx response, a new forwarded request is initiated and the headers are further overwritten.

Title: Answer
Code: respVariable
Visibility: yes
Default: — 

Variable to store the body of the HTTP response.
Not filled in if the request has not been answered.
If the request is completed with a 3xx response, a new forwarded request is initiated and the body is further overwritten.

Title: Response Coding
Code: respEncoding
Visibility: yes
Default: utf-8

The encoding of the HTTP response body. Used to convert to a string representation in a script variable.
Possible options:

  • Auto from the title (autoheader, 5)

  • Body auto (autometaheader, 6)

  • unicode (0)

  • utf-8 (1)

  • utf-7 (2)

  • cp1251 (3) – Code page windows-1251 (Cyrillic alphabet)

  • Specify name (byname, 4) - Specify the encoding name manually.

Title: Response Encoding Name
Code: respEncodingName
Visibility: yes
Default: "cp1251"

The manually specified encoding name for the response body.

Title: Error
Code: errorVariable
Visibility: no
Default: — 

Variable to store the HTTP error code.

Title: Transition
Code: transfer
Visibility: no
Default: — 

The component to which control is passed in case of successful completion of an asynchronous send operation or receipt of an HTTP response.

Title: Transition, Time
Code: transferTimeout
Visibility: yes
Default: — 

Component to which control is passed in case of response timeout.

Title: Transition, Error
Code: transferError
Visibility: no
Default: — 

See also