Creating a URIMAP resource for CICS as an HTTP client
You can create a URIMAP resource that specifies the components of the URI for an HTTP client request (scheme, host, and path) and an SSL client certificate to be used with the request, if required. When you use a URIMAP resource to open a client HTTP connection, administrators can manage any changes to the server's URI, and you can also specify that the opened connection is pooled after use for reuse by other applications. It is possible to install and enable multiple client URIMAP resources that are pointing to the same endpoint (that is, the same host, port and path).
About this task
You can name a URIMAP resource on the WEB OPEN command to provide a scheme and host name and a default path for the connection. You can also name the resource on a WEB SEND command to provide a path for the relevant request. Alternatively, you can use the WEB EXTRACT URIMAP command to extract information from the URIMAP resource and use it directly in the application program that makes the HTTP client request. URIMAP resources can also be used with the INVOKE SERVICE command to call a service.
URIMAP resources can also be used with the INVOKE SERVICE command to call a service. If you do not specify the name of the URIMAP on the INVOKE SERVICE command, CICS® will search, at run time, for a URIMAP that has USAGE(CLIENT) and a matching host and path. If one is found, this URIMAP will be used. If multiple URIMAPs are found matching the host, port and path, the one installed earliest will be used. This mechanism allows the system programmer to install a URIMAP to control attributes such as CERTIFICATE, CIPHERS, and SOCKETCLOSE without requiring application changes. As best practice, always use a URIMAP by name.
By default, after a CICS application finishes by using its client HTTP connection, CICS closes the connection. When you specify the SOCKETCLOSE attribute in the URIMAP resource, instead of closing the connection, CICS can place the connection in a pool in a dormant state. The dormant connection can be reused by the same application or by another application that connects to the same host and port to save opening a new connection. The application program uses a pooled connection in the same way as it uses a new connection.
Outbound HTTP connection pooling is controlled entirely by the SOCKETCLOSE attribute in the client URIMAP.
When you are using INVOKE SERVICE, the CICS PIPELINE code either uses a named URIMAP supplied on the command or it attempts to locate a matching client URIMAP based on the host and path. If a matching URIMAP is found, then it is passed to DFHWBCL OPEN_SESSION. Outbound connection pooling is then in use, depending on the URIMAP definition.
The PIPELINE behavior is slightly different from using WEB OPEN and WEB CONVERSE. The WEB OPEN command just passes the URIMAP to DFHWBCL if specified by the application on the command. The initial reason for this is it is the only way to set a client certificate or set of ciphers to use for outbound SSL connections in the PIPELINE. However, it also allows the system programmer to set up use of connection pooling without requiring any application changes.