|
|
Using the Sample Application
The BEA eLink Adapter into WebLogic Enterprise CORBA software includes a Sample Application. This Sample Application provides sample source code, make files, configuration files, and field definitions to help you build an eLink client. You may use this sample application to test your installation of BEA eLink Adapter into WebLogic Enterprise CORBA.
The following topics are discussed in this section:
What is Included in the Sample Application
The Sample Application provided with the BEA eLink Adapter into WebLogic Enterprise CORBA distribution is an eLink client program. The client program, e2aclient.c, makes an ATMI service call using the tpcall() function passing data in an FML32 buffer. The client program makes one of the two preconfigured service calls, UPPER or LOWER. UPPER converts a string of text to all upper case letters and LOWER converts a string of text to all lower case letters.
The sample configuration files provided as part of this distribution create an environment where the eLink Adapter for CORBA, e2a, is the only server that will respond to the UPPER and LOWER service calls. A complete list and description of all files provided as part of this sample can be found in Table A-1.
File |
Description |
---|---|
e2aclient.c |
Client source code. |
makefile.nt |
NT makefile (MS VC++ 6). |
makefile.unix |
UNIX makefile. |
e2alocal.dom |
DM configuration file for e2a to run on UNIX and and handle both local and remote requests from NT. |
e2alocal.ubb |
UBB configuration file for e2a to run on UNIX and and handle both local and remote requests from NT. |
e2aclient.txt |
Adapter Configuration file. This lists the services being advertised. This is the command line argument to e2a as specified in the CLOPT= line. |
e2aclient.flds |
Output from the FTGEN Command Line Tool. Note that this file contains the FML32 field definitions that must be manually added. |
e2aremote.dom |
DM configuration file for e2aclient to run on NT and communicate with e2a on UNIX. |
e2aremote.ubb |
UBB configuration file for e2aclient to run on NT and communicate with e2a on UNIX. |
setenv.sh |
A sample script that sets environment variables. |
The Sample Application provided with this distribution requires part of the CORBA Simpapp Application provided with the WebLogic Enterprise distribution. The binary server, simple_server, is created by building the Simpapp and is used as the CORBA application server. When the eLink Adapter for CORBA translates the service calls to method invocations, the CORBA object, Simple, is the target object that responds to the method invocation(s). The adapter configuration, e2aclient.txt, maps the UPPER service call to the to-upper method and the LOWER service call to the to-lower method of the Simple object.
The following diagram shows an example of the Sample Application process with a tpcall to UPPER initiated from the eLink Domain.
Figure 5-1 Example of Sample Application Process
Building and Running the Sample Application on Unix
The Sample Application contains a single eLink client program, e2aclient.c. Review the following prerequisites and perform the following steps to build the client program and create the Sample Application domains, eLink (e2alocal) and WLE (e2aremote).
Prerequisites
Before you begin building the sample programs, the following prerequisites should be considered:
Step 1 - Building the SIMPAPP Test Server
Since the eLink Adapter for CORBA only runs on Unix, you need only build the Unix version of the Test Server.
Note: The use of the Solaris 5.x compiler is required for Solaris.
Step 2 - Creating the Interface Repository
Using the WLE utility function, idl2ir, create an Interface Repository (.ifr) file from the simple.idl file by entering the following command:
idl2ir -f e2aclient.ifr simple.idl
Edit the CLOPT line for the UBB file SERVER entry for TMFIFRSVR to use the Interface Repository (ifr) file created above.
Step 3 - Configuring the Adapter
Configuring the adapter requires to you to modify a adapter configuration file. A sample e2aclient.txt adapter configuration file installs as part of the product for the sample application and is available for use.
Note: WLE (including ISL and TMFIFRSVR) must be booted before running the CFGEN utility.
*SERVER Section
MAXMSGLEVEL
*SERVICE Section(s)
The following SERVICE entries need to be filled in for each of the methods that your client program accesses. Note that the entries filled in by CFGEN (SERVICENAME, OBJECTNAME, METHOD, PARAMS, and RETURN) should not be edited, since any changes to this file may require changes in other files. The data for the FACTORYMETHOD and FACTORYOBJECT fields can be found in the simple.idl file.
#pragma ID SimpleFactory "IDL:beasys.com/SimpleFactory:1.0"
If e2a is your first eLink Adapter server, you will need to add the following entries to this file:
*base 2000
ELINK_ADAPTER_ERR 1 string - -
ELINK_ADAPTER_ERR_CODE 2 string - -
WLE locates this file using the following two environment variables that designate the path and file name of the FML32 Field Table File generated above:
FIELDTBLS32 contains a list of the table file names.
FLDTBLDIR32 contains a list of directories to search for the FIELDTBLS32 files.
Step 4 - Building the Client
The following procedure assumes some familiarity with writing WLE or eLink Platform client applications. Refer to the "Programming" section in the BEA Tuxedo online documentation at /http://download.oracle.com/docs/cd/E13203_01/tuxedo/tux65/ for more information on writing clients.
Note: All parameters to e2a are passed via FML32 buffers.
mkfldhdr32 e2aclient.flds
The output file is e2aclient.flds.h, which you can #include in the client source code file.
Note: The names used in the PARAMS and RETURN entries in the adapter configuration file (see step 1) are listed in the output file from FTGEN tool and are defined as macros in the .h file created by mkfldhdr32.
The FML32 buffer to be passed through tpcall() must contain all of the input parameters expected by the server program. When adding these fields to the FML32 buffer, the fieldid parameter of Fadd32() must be one of the #define FLDID32 macros listed in the .h file generated by the mkfldhdr32 program.
Building and Running the Client Program on Windows NT
The prior section described building and running the Client Program on a single Unix domain. While the BEA eLink Adapter for CORBA is available only for HP-UX and Solaris platforms, the sample client program can be built on Windows NT either as a Tuxedo or WLE client and configured to talk to a Unix-based WLE server. The sample e2aclient.c file compiles on both NT and Unix with no changes. The UBB and DOM files distributed with the sample application support running the client on NT with a remote connection to a Unix platform and are useful reference material.
Step 1 - Configuring the Server Program
Step 2 - Running the Server Program
Step 3 - Building the Client Program on NT
Note: The Microsoft Visual C++ 6.x compiler and nmake is required.
Step 4 - Configuring the Client Program
Step 5 - Running the Client Program
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|