Previous Topic: Overview of the Generated Header FileNext Topic: Communication-specific Details


Example Generated Header File

Following is an overview of the generated file. Information that is used in the associated C file is shown in bold and information specific to the communication type is shown in italicized bold. This information has been extracted from proxy generation using the current sample model which is distributed with the CA Gen product. The generated file is not reproduced in its entirety. Important aspects of the file content have been reproduced for discussion purposes.

Description

Generated File

Includes and compiler directives. Some files are included based on the communications method selected during generation. If you change communication types, you will need to regenerate the C Proxy API.

#ifndef INC_COMPONENT_P900
#define INC_COMPONENT_P900
#include <citrantb.h>

#include <proxyexe.h>
#include <proxytrc.h>
#include <proxycfg.h>
#include <proxyxit.h>

#include <tirdp_struct.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <cisrvtcp.h>

Transaction specific structure that is used to reference the import and export views.

In this example, the data in the structure can be referenced in your program as follows:

server_detail_division.importRequest_command.value

server_detail_division.exportRequest_command.value

struct s_ServerDetailDivision
{
  /* Entity View: IMPORT_REQUEST */
  /* Type: COMMAND */
  struct {
  char value[2];
  } importRequest_command;

 
  /* Entity View: EXPORT_REQUEST */
  /* Type: COMMAND */
  struct {
    char value[21];
  } exportRequest_command;
};

static struct s_ServerDetailDivision server_detail_division;

Import and Export View tables as used by the CA Gen server. Do not modify these tables since the server is expecting this structure.

static CIViewDefVal

import_view_0001835029[] = {

{DT_STRING, 1, 1, 2, 0, server_detail_division.importRequest_command.value},

… /* other data definitions */

{DT_END, 0, 0, 0, 0, 0}};

 
static CIViewDefVal export_view_0001835029[] = {

{DT_STRING, 1, 1, 2, 0, server_detail_division.exportRequest_command.value},

… /* other data definitions */

{DT_END,0,0,0,0,0}};

Service Table structure - contains a structure and information specific for the communications type selected during generation. If you change communications types you need to regenerate the C Proxy API.

static CITCPService

comm_service_0001835029 = {
"TCP",
"",
""
};

TranEntry data structure - the type is defined in citrantb.h. Each bulleted item below corresponds to a line item on the right. This structure contains the information needed for a transaction:

programid - load module name

programidalt - an alternate form of the program id (e.g. load module name)

trancode - transaction code

procName - name of the procedure to be called or advertised

procNamealt - an alternate form of the procName

procSourceName - the source name of the procedure to be called or advertised

modelName - name of the model advertised or used

modelShortName - the short name of the model advertised or used

importView - pointer to description of import view (defined above)

exportView - pointer to description of export view (defined above)

returnOnExitStates - possible exit states that the server can return on

returnOnExitCmds - commands associated with returnOnExitStates

netApplicationName - the .NET application name

netNamespace - the .NET namespace

netAssemblyVersion - the .NET assembly version

javaContext- the Java URL context (not currently used)

javaPackage - the package name for java

static CITranEntry

SERVER_DETAIL_DIVISION = {
"P900",

"P900",

"P900",

"SERVER_DETAIL_DIVISION",

"ServerDetailDivision",
"SERVERD1",

"GEN SAMPLE MODEL",

“sample”,
import_view 0001835029,
export_view 0001835029,
"","","","","","","","",
"","","","","","","","",

"sample",

"sample",

"",

"",

"com.ca",
"cfbmo",
"tcpcf",
(CIService *)&comm_service_ 0001835029};

Ending compiler directives.

*/#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */

 #endif /* INC_COMPONENT_P900 */

 /* End of p900.h

msgObjLib - core name of message object shared library such as “cfbmo.” If not defined here, it is set by ProxyConfigureComm

commMethodLib - core name of communication method shared library such as "tcpcf." If not defined here, will be set by ProxyConfigureComm

service - pointer to Service Table structure (defined above) that is a description of communication method services used or advertised

In this example, the data in the structure is referenced in your program as follows:

SERVER_DETAIL_DIVISION.service or

SERVER_DETAIL_DIVISION.modelName to change the model name