Initialize
The initialize request must precede all processing requests. Among
other things, the initialize control block contains the information
required by the API to enable it to connect to the Transaction Server. The
API requires the following information to achieve this connection:
- A host name or IP address
- A port number
- The data fields in the request parameter passed by the client application
- The data fields in the configuration file (see API configuration file)
- The default values
Preparing the call
Prior to calling the initialization request, the client application
must build the required control blocks. The initialize request requires
the following parameters:
- An initialize request control block (TSAPI_INIT_REQUEST)
- A client API handle (TSAPI_HANDLE)
Table 1 shows the input fields in the initialization
request control block for this request. The fields are either required
or optional. Refer to Table 1 for a description
of all of the fields in this control block.
| Field Name | Required |
|---|---|
| Identifier | Yes |
| pApplicationId | Yes |
| pAdjustmentRef1 | No |
| freePrevRetrievedData2 | No |
| pTransactionServerName | No |
| transactionServerPort | No |
| connectTimer | No |
| responseTimer | No |
| closeTimer | No |
| itsAppRequestTimer | No |
| pTimingsFileInfo | No |
|
Note:
|
|
Calling the API
The format of the call is shown below.
short returnCode = TsApi_Init(TSAPI_INIT_REQUEST *pInitRequest,
TSAPI_HANDLE *pTsApiHandle);The
client application must not alter the API handle either before or
after the request.Checking the Results
Following the completion of the request, the client application should check the return code. If there is a nonzero return code, the client application should check the values of the return code, reason code, and error message fields located in the request control block. If the return code is zero, the client application can check the contents of any fields in the passed control blocks that may have been updated as a result of the request.