The <connectionPolicy> element of the HTTP adapter
The structure of the <connectionPolicy> element.
The <connectionPolicy> element has the following structure:
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType"; cookiePolicy="cookie-policy" maxRedirects="int"> <protocol>protocol</protocol> <domain>host-name</domain> <port>host-port</port> <connectionTimeoutInMilliseconds>connection_timeout</connectionTimeoutInMilliseconds> <socketTimeoutInMilliseconds>socket_timeout</socketTimeoutInMilliseconds> <authentication> … </authentication> <proxy> … </proxy> <sslCertificateAlias>ssl-certificate-alias</sslCertificateAlias> <sslCertificatePassword>ssl-certificate-password</sslCertificatePassword> <maxConcurrentConnectionsPerNode>max_concurrent_connections</maxConcurrentConnectionsPerNode> </connectionPolicy>The <connectionPolicy> element has the following attributes:
Attribute Description xsi:type Mandatory. The value of this attribute must be set to http:HTTPConnectionPolicyType. cookiePolicy Optional. This attribute sets how the HTTP adapter handles cookies that arrive from the back-end application. Valid values are as follows:
- RFC_2109 (The default)
- RFC_2965
- NETSCAPE
- IGNORE_COOKIES
maxRedirects Optional. The maximum number of redirects that the HTTP adapter can follow. This attribute is useful when the back-end application sends circular redirects as a result of some error, such as authentication failures. If the attribute is set to 0, the adapter does not attempt to follow redirects at all, and the HTTP 302 response is returned to the user. Default is 10. The <connectionPolicy> element has the following subelements:
Subelement Description protocol Optional. The URL protocol to use. Possible values are http (default) and https. domain Mandatory. The host address. port Optional. The port address. Default is 80. sslCertificateAlias The alias of the adapter private SSL key, used by the HTTP adapter key manager to access the correct SSL certificate in the keystore. Optional for regular HTTP authentication and simple SSL authentication. Mandatory for mutual SSL authentication.
The keystore setup process is described in SSL certificate keystore setup
sslCertificatePassword Password of the adapter private SSL key, used by the HTTP adapter key manager to access the correct SSL certificate in the keystore. Optional for regular HTTP authentication and simple SSL authentication. Mandatory for mutual SSL authentication.
The keystore setup process is described in SSL certificate keystore setup
authentication Optional. Authentication configuration of the HTTP adapter. See The <authentication> element of the HTTP adapter. proxy Optional. Used when the back-end application must be accessed through a proxy. See The <proxy> element of the HTTP adapter. maxConcurrentConnectionsPerNode Optional. Defines the maximum number of concurrent connections which the MobileFirst Server can open to the back end. Default is 50.
See The <maxConcurrentConnectionsPerNode> element of the HTTP adapter.
connectionTimeoutInMilliseconds Optional. The timeout (in milliseconds) until a connection to the back-end can be established. Default is 30000.
By passing a different value for the connectionTimeoutInMilliseconds parameter in the invokeHttp() JavaScript function, we can override the value defined here. See WL.Server class.
socketTimeoutInMilliseconds Optional. The timeout (in milliseconds) between two consecutive packets, starting from the connection packet. Default is 30000.
By passing a different value for the socketTimeoutInMilliseconds parameter in the invokeHttp() JavaScript function, we can override the value defined here. See WL.Server class.
Setting the socketTimeoutInMilliseconds and connectionTimeoutInMilliseconds timeouts does not ensure a timeout exception will occur after a specific time has elapsed since the invocation of the HTTP request.
For example, assume the adapter socketTimeoutInMilliseconds has been set to 10 seconds and connectionTimeoutInMilliseconds has been set to five seconds. If the initial connection takes eight seconds (meaning, the connectionTimeoutInMilliseconds period has not passed) and server processing takes an additional three seconds (meaning, the socketTimeoutInMilliseconds period has not passed), the response will occur only after 11 seconds. If network connectivity between the MobileFirst Server and the back end has slowed severely, and a large amount of data is transferred, no timeout will occur; however, assuming at least one data packet is sent no more than five seconds apart, the result will return after a long time.
Parent topic: The adapter XML File