Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 6 HTTP Palette : Send HTTP Request

Send HTTP Request
Activity
The Send HTTP Request activity sends a HTTP request to a web server.
This activity can send a request to a server that complies with either the HTTP 1.0 or 1.1 specification. You do not need to specify the HTTP version of the server you are sending the request to. TIBCO ActiveMatrix BusinessWorks automatically sends the request using the correct version based on the version supported by the HTTP server.
Configuration
The Configuration tab has the following fields.
Specifies to use a proxy server to gain access outside of a firewall. The Proxy Configuration shared configuration resource specifies the configuration of the proxy server. See Proxy Configuration for more information.
These parameters are specified in the parameters element on the Input tab.
See Sending Data in the HTTP Request for more information about this field.
See TIBCO Designer Palette Reference for more information.
Sending Data in the HTTP Request
There are several HTTP methods that can be used in an HTTP request. Each method sends data in the request in a different manner. For example, the GET method uses the query string of the request URI to pass parameter/value pairs. Other methods use the HTTP message body to send data in the request.
The Send HTTP Request activity has three input elements for sending data in a request:
For some methods, these input elements are mutually exclusive. For example, for POST requests, you can specify parameters on the Configuration tab and in the parameters input element or you can specify a PostData input element. However, you should not specify both input elements. In the case of a POST request, the PostData input element is ignored when parameters are specified on the Configuration tab.
For GET requests, you can specify parameters on the Configuration tab and in the parameters input element or you can specify a QueryString input element. Typically, if you know the list of parameters for the request, you should configure the parameters on the Configuration tab. If the list of parameters is not known until the activity executes, you should use the QueryString element. However, when all parameters on the Configuration tab are specified as Optional, you can use the QueryString input element instead of the parameters input element (but if any elements in the parameters element contain an expression, the QueryString element is ignored).
Special Characters in HTTP Requests
Depending upon the content type of the data for the request, the request can contain URL-encoded data and the server is expected to decode the data. If this is the case and you want to send special characters such as +, /, or = in your HTTP request, your data string must be URL-encoded if you send the data using the PostData or QueryString input elements. If you send the data using the parameters specified on the Configuration tab, encoding is done automatically.
For example, you want to specify the following PostData:
 
name=John Smith&address=500 1/2 Main Street
Your PostData input element should result in the following string:
 
name=John%20Smith&address=500%201%2F2%20Main%20Street
See http://www.rfc-editor.org/rfc/rfc1738.txt for more information about the URL specification.
Configure SSL Button
The Configure SSL button allows you to specify the SSL parameters for the HTTP request. The following are the fields in the SSL Configuration for HTTPS Client Requests dialog:
See TIBCO Designer Palette Reference for more information.
Note: If you specify an equivalent hostname (for example, an IP address) in the Host field, but the name is not an exact match of the hostname in the host’s digital certificate, the connection is refused.
When checked, this field specifies that the minimum strength of the cipher suites used can be specified with the bw.plugin.security.strongcipher.minstrength custom engine property. See TIBCO ActiveMatrix BusinessWorks Administration for more information about this property. The default value of the property disables cipher suites with an effective key length below 128 bits.
 
Set the property jsse.enableSNIExtension to false to disable the SNI extension.
Advanced
The Advanced tab contains the following fields:
Note: This option is not intended to be used with the Parse Post Method Data option on the Configuration tab. When Write to File is specified, the PostData output element becomes a choice element containing either the output FileName or the PostData depending upon whether the data exceeds the size specified in the Threshold Size field. It is recommended to use either the Write to File option or the Parse Post Method data option, but not both at the same time.
Note: Once written, the files created by using this option are not deleted automatically. You must manage the storage used by these files and delete them when they are no longer used.
Input Headers/Output Headers
The Input Headers and Output Headers tabs describe the data structure for the headers of the HTTP request and the HTTP reply message. You can use the default structure, or you can alter the structure, if the outgoing request or the reply to the request has a specific data structure for the header. This tab uses the same mechanism described Appendix A, Specifying Data Schema to specify the data structure for the headers. See that section for more information about creating a customized data structure.
Header structure is defined by the HTTP protocol. See the HTTP Protocol specification for more information about the fields and content of the header of a HTTP request. You can obtain this specification at www.w3.org.
The default header fields are the following.
This field specifies media types that are acceptable for response messages for the request. For example, text/*,text/html. Media types are described in the HTTP specification.
This field specifies the character sets that are acceptable for response messages for the request. For example, iso-8859-5, unicode-1-1. Character sets are described in the HTTP specification.
This field specifies the content-coding values that are acceptable for response messages. For example, compress, gzip. See the HTTP specification for more information about this header field.
This field allows the requestor to specify options desired for this connection. For example, the option close specifies that the requestor would like the connection to be closed when the request is complete.
If you set the custom engine property bw.plugin.http.protocol.single-cookie-header to true, multiple name/value pairs are sent as a single header element. See TIBCO ActiveMatrix BusinessWorks Administration for more information about custom engine properties.
Input
See TIBCO ActiveMatrix BusinessWorks Process Design for more information about mapping and transforming input data.
The input for the activity is the following.
See Sending Data in the HTTP Request for more information about this input element.
See Sending Data in the HTTP Request for more information about this input element.
"The header [ headerName ] is defined as non-Repeating Header in Input Headers. This header cannot have multiple occurences in DynamicHeaders."
See Sending Data in the HTTP Request for more information about this input element.
Note: Only HTTP POST method can send messages with attachments.
content-disposition — To suggest a filename for an attachment, use "*;filename=<filename>" in this element. Note: HTTP servers may alter or choose to ignore the suggested name.
See http://www.faqs.org/rfcs/rfc2045.html for more information about MIME headers and their syntax.
Note: When the content type is specified as "text/*" (for example, "text/xml"), the attachment content is expected to be in either the textContent input element or the file name storing the attachment is expected to be in the fileName input element. When the content type is anything other than "text/*", the attachment content is expected to be in either the binaryContent input element or the file name storing the attachment is expected to be in the fileName input element.
Output
The output for the activity is the following.
"The header [ headerName ] is defined as non-Repeating Header in Input Headers. This header cannot have multiple occurences in DynamicHeaders."
content-disposition — To suggest a filename for an attachment, use "*;filename=<filename>" in this element. Note: HTTP servers may alter or choose to ignore the suggested name.
See http://www.faqs.org/rfcs/rfc2045.html for more information about MIME headers and their syntax.
Note: When the content type is specified as "text/*" (for example, "text/xml"), the attachment content is expected to be in either the textContent input element or the file name storing the attachment is expected to be in the fileName input element. When the content type is anything other than "text/*", the attachment content is expected to be in either the binaryContent input element or the file name storing the attachment is expected to be in the fileName input element.
Persistent Connections
A Send HTTP Request activity requires a connection to the HTTP server. The activity exclusively uses the connection until the HTTP server sends the response message. If you have many process instances connecting to a HTTP server, each Send HTTP Request opens a connection, holds the connection, and then closes the connection when the activity completes. Opening and closing a large number of connections causes a significant overhead. Persistent connections play a major role here. Persistent connections maintain a pool of connections that can be reused by Send HTTP Request activities so that each activity does not need to open and close the connection. Once the connection is released by the process instance, it is returned to the pool maintained.
Figure 10 illustrates the persistent connection pool.
Persistent Connection Manager allows you to specify the total number of connections as well as the maximum number of connections per HTTP Server. The total number of connections is a total of connections to all HTTP Servers handled by that connection pool.
For each SSL configuration, a different Persistent Connection pool is created and maintained. All connections using the same SSL Configuration, irrespective of the HTTPS Server they are connecting to, is maintained by this pool.
When a Send HTTP Request activity requires a connection, the pool is requested for a connection that corresponds to the HTTP server. If an idle connection for that HTTP Server is found, it is used. If no idle connection is found, the pool tries to create one depending on whether the maximum connections limit for that HTTP Server has been reached. If the maximum connections limit is reached, the request waits for a connection to be released back to the pool. If the maximum connections limit is not reached, the pool creates a connection to use.
Figure 10 Persistent HTTP Connection Pool
Persistent connections are managed by custom engine properties. See TIBCO ActiveMatrix BusinessWorks Administration for more information about setting custom engine properties.
The following section describe the engine properties that control persistent connections.
bw.plugin.http.client.usePersistentConnectionManager
This property specifies that a pool of HTTP connections to each HTTP server must be created for the connections to be reused by the Send HTTP Request activities. This property enables persistent connections for all non-SSL Send HTTP Request in that ActiveMatrix BusinessWorks engine.
When this property is set to true, a pool of connections is created for each HTTP server that Send HTTP Request connects to. The total number of connections in the pool is limited by the bw.plugin.http.client.maxTotalConnections property. The number of connections for each host (each HTTP server) is limited by the bw.plugin.http.client.maxConnectionsPerHost property.
The default value of this property is false.
bw.plugin.http.client.usePersistentConnectionManagerForSSL
This property specifies that a pool of HTTPS connections to each HTTP server must be created for connections to be reused by the Send HTTP Request activities. This property enables persistent connections for all SSL Send HTTP Request in that ActiveMatrix BusinessWorks engine.
When this property is set to true, a pool of connections is created for each HTTPS server that Send HTTP Request connects to. The total number of connections in the pool is limited by the bw.plugin.http.client.maxTotalConnections property. The number of connections for each host is limited by the bw.plugin.http.client.maxConnectionsPerHost property.
The default value of this property is false.
SSL Configuration - consists of Trusted Certificates folder, Identity, verifyHostName flag, and strongCipherSuites flag.
All persistent connection properties like maxTotalConnections, maxConnectionsPerHost, idle connections check, and timeout value are applied on each connection pool.
To enable Persistent Connections for both HTTP and HTTPS, set bw.plugin.http.client.usePersistentConnectionManager and bw.plugin.http.client.usePersistentConnectionManagerForSSL properties to true.
Define the engine property bw.plugin.http.client.authentication.preemptive to False, if you don’t need the preemptive authentication applied for the HTTP Requests. The default value of this property is True.
bw.plugin.http.client.connectionTimeout
The value of this property is ignored unless the bw.plugin.http.client.usePersistentConnectionManager or bw.plugin.http.client.usePersistentConnectionManagerForSSL property is set to true. This property specifies that the timeout period (in milliseconds) for which persistent connections should be alive to each remote HTTP server.
The default value of this property is 3000 ms.
bw.plugin.http.client.maxConnectionsPerHost
The value of this property is ignored unless the bw.plugin.http.client.usePersistentConnectionManager or bw.plugin.http.client.usePersistentConnectionManagerForSSL property is set to true. This property specifies the maximum number of persistent connections to each remote HTTP server.
The default value of this property is 20.
bw.plugin.http.client.maxTotalConnections
The value of this property is ignored unless the bw.plugin.http.client.usePersistentConnectionManager or bw.plugin.http.client.usePersistentConnectionManagerForSSL property is set to true. This property specifies the maximum number of persistent connections for all HTTP servers.
The default value of this property is 200.
bw.plugin.http.client.checkForStaleConnections
The value of this property is ignored unless the bw.plugin.http.client.usePersistentConnectionManager or bw.plugin.http.client.usePersistentConnectionManagerForSSL property is set to true. When using persistent connections, a connection can become stale. When this property is set to true, a persistent connection is checked to determine if it is stale before it is used by a Send HTTP Request activity. Checking for the stale connections adds significant processing overhead, but it improves reliability.
The default value of this property is false.
Error Output
The Error Output tab lists the possible exceptions that can be thrown by this activity. See TIBCO ActiveMatrix BusinessWorks Error Codes for more information about error codes and corrective actions to take.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved