API configuration file

When the API connects to the Transaction Server, it requires the hostname or IP address and the port number of the Transaction Server. This information can be supplied by the client application by using fields in the relevant control block, or it can be retrieved from the API configuration file. If none of these fields are present, the default values, which are an IP address of 127.0.0.1 and a port number of 2002, are used.

The benefit of using an API configuration file is that the client application programming is simplified by not requiring a hardcoded Transaction Server address. In addition, client applications can quickly be switched from one Transaction Server to another, which makes the application transition from a test environment to a production environment much smoother. It also provides a more robust system recovery strategy.

A sample API configuration file that is called sampapi.cfg is supplied as part of the Transaction Server API development kit. The file contains the following optional parameters:
transactionServerName
Hostname or IP address.
transactionServerPort
The port number to connect to.
connectTimer
Amount of time to wait for a connection to the Transaction Server.
responseTimer
Amount of time to wait for a response from the Transaction Server.
closeTimer
Amount of time to wait to disconnect from the Transaction Server.
traceOn
Internal trace option (true or false).
traceFile
Directory name for the trace file. For example, c:\temp.
processTimingFilename
File name used to create the timing CSV file. If this name is specified, a timing CSV file with various timing type information is created. The file is created in a format that can be opened directly by Microsoft Excel. Do not specify a file extension for this file name because an extension of CSV is automatically appended to it. For example, .\TSAPITiming produces a timing file that is named TSAPITiming0.csv in the current run directory. After the file reaches the size that is specified, it becomes TSAPITiming1.csv and a new TSAPITiming0.csv is created.
processTimingFileMaxSize
Specifies the maximum size of the file that is indicated by the processTimingFilename parameter. After the size is reached, the *0.csv is copied to a *1.csv version and the *0.csv version is emptied.

Linux

To activate the API configuration file for Linux®, set the following environment variables:
export itsapicfg=filename
The file name needs to be the fully qualified name of the API configuration file that is to be used by the Transaction Server API.
Note: Trace information that is created by the API is intended only for IBM® Support purposes. Do not activate it except at the request of IBM Support staff.