HTTP(S) Connector
This adapter communicates with servers using the HyperText Transfer Protocol (HTTP) or HTTP Secure (HTTPS) based on the Apache HttpClient in version 4. This adapter provides the standard HTTP methods GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE and PATCH. Moreover, user-defined HTTP methods can be used. It supports HTTP basic, digest and NTLMv2 authentication, as well as proxy servers and preemptive authentication. Moreover, the adapter supports Server Name Indication for HTTPS connections, and client certificates to validate requests.
Please note:
In default mode (parameter
fromXMLis disabled), the adapter processes, depending on the operation, any input document using its original content type and encoding.In expert mode (parameter
fromXMLis enabled), the adapter processes only a specific XML document that may include headers, cookie information etc. and which allows to have more control of the HTTP(S) operation, see parameterfromXMLand input description below..- This adapter replaces the existing adapter HTTP(S) Communication, see (7.4.0-en) HTTP(S) Communication (deprecated).
Properties
| Operation | Defines the operation executed by the function adapter Possible values:
|
Parameters
| Adapter | Main adapter class (do not change!) Possible values: de.softproject.integration.adapter.http4.HttpClient4Adapter: Main class (Default) |
| protocol | Used protocol (HTTP or HTTPS) Possible values:
|
| host | IP address or host name of the physical server Note: The Possible values: Any valid string without protocol handler (e. g. |
| vHost | Virtual host name, if it cannot be identified by the physical host within the parameter Note: The The ports can be specified, except for ports 80 (default for HTTP connections) and 443 (default for HTTPS connections). Possible values: Any valid string without protocol handler (z. B. |
| port | Port number of the HTTP(S) service Possible values:
|
| path | Path on the server, starting with a slash Possible values: Any valid path (e. g. |
| method | Name of the HTTP method to be used for the operation Possible values: Any string |
| authenticationEncoding | Character encoding for the credentials Possible values: Specification of a character encoding, e.g.
|
| query | Argument(s) of the HTTP(S) request Possible values: Any URL-encoded arguments without leading question marks (e. g. |
| username | User name for basic HTTP, digest, or NTLM authentication Possible values:
|
| password | Password for basic, digest, or NTLM authentication Possible values: Any valid string |
| token | Token for bearer authentication
|
| ntlmWorkstation | Workstation (computer name) of the client (only for NTLM authentication, see parameter Possible values: Any valid workstation name |
| ntlmDomain | Domain name (only for NTLM authentication, see parameter Possible values: Any valid domain name (NetBIOS name) |
| usePreemptiveBasicAuth | Use preemptive authentication (using credentials from the parameters Possible values:
|
| allowBasic | Use HTTP(S) basic authentication Possible values:
|
| allowDigest | Use digest authentication Possible values:
|
| allowNtlm | Use proprietary NTLM server authentication by Microsoft Possible values:
|
| fromXml | Enable expert mode; The adapter now expects a specific XML document including headers, cookie information etc. that allows more control of the HTTP(S) operation Note: In expert mode, the Possible values:
|
| toXml | Output an XML document containing all headers as elements and the body content as Base64-encoded string Possible values:
|
| hideCookieHeader | Output header elements also with cookie information in the result XML document (when parameter Possible values:
|
| useProxy | Use a proxy server to connect Possible values:
|
| proxyHost | IP address or host name of a proxy server Possible values: Any valid string (e. g. |
| proxyPort | Port number of the proxy server Possible values:
|
| proxyUsername | User name for Basic HTTP, digest, or NTLM authentication on a proxy server Possible values:
|
| proxyPassword | Password of a proxy server Possible values: Any valid string |
| proxyNtlmWorkstation | Workstation (computer name) where the authentication request comes from (for an NTLM authentication via NTLM proxy) Possible values: Any valid workstation name |
| proxyNtlmDomain | Windows domain for an NTLM authentication via NTLM proxy Possible values: Any valid domain name |
| proxyUsePreemptiveBasicAuth | Enable preemptive authentication (using credentials from the parameters Possible values:
|
| proxyAllowBasic | Use basic authentication for the proxy Possible values:
|
| proxyAllowDigest | Use digest authentication for the proxy Possible values:
|
| proxyAllowNtlm | Use proprietary NTLM server authentication by Microsoft for the proxy Possible values:
|
| connectTimeout | Timeout value for a socket connect in milliseconds Possible values:
|
| socketTimeout | Timeout value between two incoming data packages in milliseconds. This is not the maximal request time, only the maximal idle time of the connection. Possible values:
|
| redirectsEnabled | Allow URL redirects for server responses with HTTP status Possible values:
|
| circularRedirectsEnabled | Allow circular URL redirects for server responses with HTTP status Possible values:
|
| maxRedirects | Maximum number of URL redirects for server responses with HTTP status Possible values:
|
| acceptAllCertificates | Disable certificate checking Possible values:
|
| acceptAllSslHostnames | Disable hostname checking for certificates Possible values:
|
| useClientCertificate | Use client certificates to validate the request Possible values:
|
| keystoreType | Keystore type for storing client certificates (see http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html#KeyStore) Possible values:
|
| keystoreURL | Keystore URL to validate the request via client certificates Possible values: Any valid URL, e.g. |
| keystorePassword | Password for the keystore to validate the request via client certificates Possible values: Any valid string |
| keyAlias | Key alias to access a specific key within the keystore Possible values: Any valid string |
| aliasPassword | Corresponding password for a specific key within the keystore Possible values: Any valid string |
Status values
| Technical error: Server does not respond, or the adapter input XML cannot be parsed (only if expert mode has been enabled via the parameter |
| Three-digit HTTP status code depending on the response, see http://tools.ietf.org/html/rfc2616#section-6.1.1 |
Input (Default mode)
By default (parameter fromXML is disabled), depending on the operation, this adapter processes any input document using its original content type and encoding.
Input (Expert mode)
In expert mode (Parameter fromXML enabled) the adapter processes a specific XML document that may include headers, cookie information etc. that allows more control of the HTTP(S) operation.
This XML structure corresponds to the adapter's output XML structure, if the parameter toXml is enabled. In addition, it almost completely corresponds to the X4 ReST interface (If in the configuration file <X4>/X4DB/0/restconfig.xml an attribute isDirect="false" has been defined for a URI operation). The main difference to the X4 ReST result XML document is the name of the element that contains the Base64-encoded body (<Content> instead of <Body> for the adapter).
Within the element <Cookies>, cookies can be specified, each within in an element <Cookie>:
<Request>
<Headers>
<Header>
<Name><!--HTTP header name--></Name>
<Value><!--Header value--></Value>
</Header>
<!-- Or for date values: -->
<Header>
<Name><!--HTTP header name--></Name>
<Date timezone="Timezone"><!--Header date value--></Date>
</Header>
</Headers>
<Cookies>
<Cookie expires="Expiry date" path="Path" domain="Domain">
<Version><!--Version number--></Version>
<Secure/> <!-- If Secure attribute is set -->
<Persistent /> <!-- For a persistent cookie -->
<Domain><!--Domain--></Domain>
<Path><!--Path--></Path>
<Name><!--Cookie name--></Name>
<Value><!--Cookie value--></Value>
<ExpiryDate><!--Expiry date in format YYYY-MM-DD hh:mm:ss--></ExpiryDate>
</Cookie>
</Cookies>
<Body><!--Base64-encoded data of the HTTP request--></Body>
</Request>
Operation Execute
For the operation Execute in conjunction with the activated parameter fromXML, the HTTP method can also be set within the Input XML as follows:
<Request method="CUSTOM_METHOD">
<Headers>
<!-- ... -->
</Headers>
<Cookies>
<!-- ... -->
</Cookies>
<Body><!--Base64-encoded data of the HTTP request--></Body>
</Request>
Output
By default (if parameter toXml is disabled) the result document of the HTTP(S) request will be outputted.
If the parameter toXml is enabled, an XML document will be outputted, that contains all HTTP header information of the response within element <Header>. If a header value contains multiple values separated by comma, these parts will be also outputtes each in an element <Element> within the children elements <Name> and <Value>.
The body content will be outputted as Base64-encoded string in the element <Body>. If the parameter hideCookieHeader has been disabled, each header causing the cookie will be outputted additionally.
<Response>
<Request line="HTTP request line">
<Method><!--HTTP method--></Method>
<URI><!--Path on the server--></URI>
<Protocol>HTTP/1.1</Protocol>
</Request>
<Status line="HTTP status line">
<Code><!--Three-digit status code--></Code>
<Reason><!--Status name--></Reason>
<Protocol><!--HTTP/1.1</Protocol>
</Status>
<Headers>
<Header>
<Name><!--HTTP header name--></Name>
<Value><!--Header value--></Value>
</Header>
<!-- Or in case of date values: -->
<Header>
<Name><!--HTTP header name--></Name>
<Date timezone="Timezone"><!--Header date value--></Date>
</Header>
</Headers>
<Cookies>
<Cookie expires="Expiry date" path="Path" domain="Domain">
<Version><!--Version number--></Version>
<Secure/> <!-- If attribute secure is set -->
<Persistent /> <!-- For a persistent cookie -->
<Domain><!--Domain--></Domain>
<Path><!--Path</Path>
<Name><!--Cookie name--></Name>
<Value><!--Cookie value--></Value>
<ExpiryDate><!--Expity date in the format YYYY-MM-DD hh:mm:ss--></ExpiryDate>
</Cookie>
</Cookies>
<Body><!--Base64-encoded data of the response body--></Body>
</Response>