Data Transformation Engine Services Guide

Chapter 6 – Service Usage Scenarios
27
Client Specifies the Input Data, Output Data is Sent Back
In this scenario, the CORBA Client makes a request to the CORBA Server along with its own input
data. The CORBA Server executes a map, transforms the input data, and returns the transformed data
back to the client as a response.
The CORBA client request contains the map name and the data to be transformed. The map’s input card
1 shall be overridden. The NonStop
DTE, rather than reading the input according to the map settings,
gets the data from the CORBA Transformation Server. The NonStop
DTE transforms the data and
sends back the transformed data as a response message.
The following line shows the command to run the CORBA Client (dteorbclnt).
Note:
1) When running the scenario "dteorbclnt ContactToLabel.nsk "" 1", copy the file Contact.txt
from /usr/tandem/nsdte/examples/corba to /usr/tandem/nsdte/bin.
2) The NonStop DTE-CORBA Server and Command Server log all the error messages to the
file: /tmp/mercAbort.log if a directory "tmp" is not created under MERC_HOME_DIR.
The first argument
ContactToLabel.nsk is the name of the compiled map to be executed. The second
argument
myContact.txt is the file that contains the input data to be sent to the server. The last
argument
1 indicates that the output card #1 is overridden and the transformed data sent back to the
client.
In the NonStop DTE sample client C++ code, the CORBA Transformation Client makes the CORBA
transform() API call similarly to the following statements:
The first parameter argv[1]
contains the name of the map (ContactToLabel.nsk) from the command
line. The second parameter data
contains the data fetched from the input file (myContact.txt). The
third parameter atoi(argv[3])
is the output card number. The return value outData contains the
transformed data.
CORBA
Client
CORBA Server
Map
: dteorbclnt ContactToLabel.nsk myContact.txt 1
DTEORBServ_var lp_DTEORBServ_obj; …
ifstream iFile(argv[2], ios::in );
char *data = new char[bufferSize];
iFile >> data;
char *outData = lp_DTEORBServ_obj ->transform(argv[1], data,
atoi(argv[3]));