HTTP gateway

 

HTTP Gateway

This Service is used to perform an HTTP request. The content of MessagePart-In can be used as POST data or as URL info in a GET request. The response of the HTTP request is placed in MessagePart-Out.

Multipart/form-data upload

The gateway also supports uploading ConnectMessages as multipart/form-data. You will need to Enable Multipart Upload to use this feature.

A ConnectMessage can consist of multiple message parts. The Multipart Specification TypeMultipart List and Multipart List attributes determine which of these parts are included in the resulting multipart/form-data upload.

Each part in a multipart/form-data request has its own Content-Type header. The default Content-Type value depends on the type of ConnectMessagePart that is included:

ConnectMessagePart type Multipart/form-data part Content-Type
TEXT text/plain; charset=utf-8
DOCUMENT (XML) application/xml; charset=utf-8
BYTE_ARRAY application/octet-stream
OBJECT application/octet-stream
FILE application/octet-stream

The default Content-Type can be overridden by adding a header multipart.content-type to the ConnectMessagePart with the desired value. Note that in the case of TEXT or DOCUMENT parts if the new Content-Type includes a charset attribute, this charset is used to convert the payload to the desired character encoding.

Besides a Content-Type header each part in the multipart/form-data payload will also have a Content-Disposition header with the value form-data. The Content-Disposition header value has a mandatory name attribute. By default this name attribute gets the name of the ConnectMessagePart. There is also an optional filename attribute that by default is not set. The name and filename attributes can be explicitly defined by adding a multipart.name and multipart.filename header to the ConnectMessagePart.

 

 

In the table below, you will find an explanation of these properties. All attributes with a ‘*’ are mandatory.

Attribute

Description

Name*

By default, we fill this out with the technical ‘tag’, followed by a serial number. Changing the name is optional.

Enabled

Set this value to true, if you want this service to be enabled at startup

MessagePart In

Here, you can specify the name of the MessagePart, which will be used as input. The value of this MessagePart becomes the POST data in a POST request or is used in a URL, depending on the definition of the URL parameter.

The default value is msgprt0. Only use this when you are in fact using different names and/or MessageParts.

MessagePart Out

Here, you can specify the name of the MessagePart, which will be used as output for the service method. The response of the HTTP request is put on this MessagePart. The default value is msgprt0.

HTTP Method

Here, you can choose the HTTP method you would like to use: GET, POST, DELETE or PUT. The default value is GET.

URL

The URL location where the HTTP request has to go. A placeholder can be used in the URL (or for the entire URL). The name of this placeholder is {url-placeholder} (NO $-sign!). If the placeholder is used, this placeholder is replaced by the content of MessagePart-In. This allows the URL location to be dynamically determined by the preceding services. The default value is {url-placeholder}.

Encode URI

This is a selection field where you have the possibility to turn the encoding of the URI off (‘true’ or ‘false’). On default this is enabled.

URL From Header

Specify which header to use as URL value.

Time Out

Maximum time in miliseconds to wait on a single request. Default is 0, which means indefinitely.

Response Class

Specify return messagepart type, either TEXT or BYTES. Defaults to 'TEXT'

Mapped Request Headers

Comma separated list of ConnectMessage properties which are mapped to the HTTP Headers.

Mapped Response Headers

Comma separated list of HTTP Headers which are mapped to the ConnectMessage properties.

Non-Standard HTTP Header Prefix

Prefix used for non-standard HTTP Headers. By default this is X-.

Username

Here, you enter the login name for Basic Authentication of NTLM support.

Password

Here, you enter the password for Basic Authentication of NTLM support, belonging to the Username.

Domain

Here, you enter the domain for NTLM support.

Preemptive Authentication

Specify whether to use Preemptive Authentication. By default this is set to false.

Preserve Analyze headers

 

Switch to enable or disable preservation of Analyze headers. The default is set to false.

Use Form URL Encoded

Switch to enable or disable use of application/x-www-form-urlencoded

MessagePart data should be formatted accordingly:

  1. Basic syntax example: key1=value1&key2=value2&keyN=valueN
  2. Json syntax example: {"key1":"value1","key2":"value2","keyN":"valueN"}
  3. XML syntax example: <form><key1>value1</key1><key2>value2</key2><keyN>valueN</keyN></form>
Content Type

Specify which Content-Type to use

Enable Cookie Management

Enables or disables the cookie management settings in the http client. When set to disabled, cookie headers will no longer be managed automatically.

Cookie Policy

Specify which Cookie Policy to use.

Enable X509 Authentication

Enables or disables X509 authentication. When set to enabled, you must provide an alias to an existing private key in your keystore for authentication.

Client Certificate

Specify which client certificate to use for X509 authentication. You should provide an alias to an existing private key in your keystore for authentication.

Enable Multipart Upload

Enables uploading ConnectMessageParts as multipart/form-data. Note that this overwrites the Content Type and the MessagePart In attributes.

Multipart Specification Type

Only available if Enable Multipart Upload is set to true.

The manner in which to define which ConnectMessageParts are to be included.

ALL - Include all part.

LIST - Include only the parts that are mentioned in a list of part names.

REGEX - Include only the parts that match a regex.

Multipart List

Only available if Multipart Specification Type is set to LIST.

A list of ConnectMessageParts that should be included in the multipart upload.

Multipart Regex

Only available if Multipart Specification Type is set to REGEX.

If the name of a ConnectMessagePart matches this regex, this part is included in the multipart upload.

Enable Request Logging

Enable request logging. Note that the logging output is not exactly the same as the sent request.

Enable Response Logging

Enable response logging. Note that the logging output is not exactly the same as the received response.

Description

Description of the specific service. This is for documentation purposes.

 

Advanced options

Attribute Description
Custom HTTP Request Factory Here, you can choose an existing HTTP Request Factory Bean. The Bean needs to be known within the corresponding Interface in the Interface Overview.

 

Using Cookies in next HTTP requests

The default behavior is that the HTTP Gateway manages the cookies for you and makes them available in the ConnectMessage headers. You call a login service that may return one or more cookies in the HTTP response (all potentially with the same name).

If you enter the name of the cookie header in the 'Mapped Response Headers' field (usually "Cookie" or "Set-Cookie"), it will be placed on the ConnectMessage. If there are multiple headers with the same name in the response, they will be concatenated.

This all occurs with the default settings for cookie policy. The other policies are primarily to support older browser-based services and are rarely necessary.