Passing input to and getting output from the EC Gateway DLL shared library [EDI 4.2]

The EC Gateway DLL shared library includes the ability to pass input into EC Gateway from the calling program and return output to the calling program. This is accomplished through an array of data structures called DATAIOSTRUCT where each structure contains a tag name, a pointer to the value, the length of the value, and the length of the buffer containing the value. Each structure can be referenced by its tag name or by its index, which is its position in the array structure.

With this capability, EC Gateway can dynamically increase the size of the array that it returns to the calling program. For example, if EC Gateway were to return an output for each item in the data, it would not know in advance, nor would the calling program know, how many items are to be returned. However, the array can be increased in size, one structure for each item found in the data.

The syntax for calling the DLL shared library is:

__declspec( dllexport ) int __stdcall wsprocesDataIO (LPSTR  lpszCmdLine, DATAIOSTRUCT ** pDataIO)

where lpszCmdLine is the command line for the wsproces executable defined in section 3.6.

The structure DATAIOSTRUCT is defined as:

typedef struct {
char *tag;
char **pdata;
long *pdatalen;
long *pbuflen;
} DATAIOSTRUCT;

This structure has four fields, which are:

The array is terminated by an extra structure with its tag pointer set to NULL.

With this API, if there is no input data or output data to be passed in memory, the array of data I/O structures is not needed and the calling application should set the second parameter to NULL. The calling application must define a command line, which must include the script file name. For upward compatibility, for example if converting from the executable to the DLL, you can still enter the input parameters using the command line syntax of -p1 through -p20 and you can still assign them using the Assign command.

Use the AssignInput and AssignOutput commands to move data between the array of data structures and EC Gateway message variables, parameter variables, or shared memory variables.

When using the AssignInput command, you must provide values for the Destination, Source By, and Source Value parameters.

When you use the AssignOutput command, you must provide the values for Destination By, Destination Value, Source Data, and Overwrite/Append parameters.