API Configuration File

When the API connects to the Transaction Server, it requires the host name or IP address and the port number of the Transaction Server. This information can be supplied by the client application using fields in the relevant control block, or it can be retrieved from the API configuration file. If none of these 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 the that client application programming is simplified by not requiring a hard-coded Transaction Server address. In addition, client applications can quickly be switched from one Transaction Server to another, making the application transition from a test environment to a production environment much smoother and also to providing a more robust system recovery strategy.

A sample API configuration file called sampapi.cfg is supplied as part of the Transaction Server API development kit. The file contains the following optional parameters:
transactionServerName
Host name/IP address
transactionServerPort
Port number to connect to
connectTimer
Wait time when connecting to Transaction Server
responseTimer
Wait time when waiting for a response from the Transaction Server
closeTimer
Wait time when waiting 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 which 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 in the current run directory named TSAPITiming0.csv. Once the file reaches the size specified, it becomes TSAPITiming1.csv and a new TSAPITiming0.csv is created.
processTimingFileMaxSize
Specifies the maximum size of the file 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 should be the fully qualified name of the API configuration file that is to be used by the Transaction Server API.
Note: Trace information created by the API is intended only for IBM® Support purposes. Do not activate it except at the request of IBM Support staff.