Debugging API programs


Use the following information to solve problems with your API program by using logging and the driver program:




Logging AR System activity

Logging the actions of your API program can help you determine the reason for your program not performing the operation that you expect. For example, you might discover that a filter or escalation is interfering with your program, thereby causing unexpected results.

To turn on and manage most types of log files, use the Log Files tab on the AR System Administration Console: Server Information form. For example, turning on API logging causes the server to record all API calls it receives in the log file that you specify.

221_LogTab.PNG

Each entry in a log file identifies the function name, key parameter values, and the return value. In addition, you can use the ARAPILOGGING environment variable to capture commands to the server and server responses for any application that uses the AR System C API.

For information about the settings on the Log Files tab on the Server Information form, see Setting-log-files-options. For information about how to use log files and the actions tracked by each type of log file, see Enabling-and-analyzing-logs.

Using the driver program

The driver program provides a command-line interface for calling API functions and viewing return values.

On a Windows installation, the driver program is installed in the Api\driver directory under the server directory. On Linux and UNIX installations, it is installed in the api/src/driver directory under the server directory.

The driver program also includes print routines for every data structure in the API, making it a useful manual debugging tool. The driver program is not interactive, but you can use it to log in to the AR System server and observe the results and behavior of the equivalent function calls that you make in your API programs.

After compiling the source code or locating the prebuilt program supplied with the API, you can use a driver for a number of purposes, such as:

  • To identify function input parameters and load them with appropriate values
  • To examine the content and structure of function output parameters
  • To experiment with different parameter values


Using the driver program

  1. Make sure your AR System server is running.
  2. Open the javadriver.bat file located in the <ARSystem_Installation_Home>\Arserver\api\lib\ directory. 
  3. Initialize an API session with the init command.
  4. Specify the login parameters with the log command.
    Login as an administrator so that you have administrative privileges. Demo is the default system administrator.
  5. Specify the server port using the ssp command.
  6. Run the ver command.
    The ver command checks if the information provided is correct and the Java driver is connected to the AR System server.
  7. Type the abbreviation of the function call at the command line, and enter the appropriate input parameter values.
    For a list of abbreviations, type: ? 

For more information about programming with JAVA API, see Programming-with-the-Java-API.

Important

The driver program is provided as a sample code and is not a supported AR System utility.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*