Corporate Info | News | Solutions | Products | Partners | Services | Events | Download | How To Buy
eLink Adapter Development Kit Doc Home | Previous Topic | Next Topic | Contents |

Configuring and Running the Sample Adapters

The eLink Adapter Development Kit includes a Sample Application to eLink Adapter, a Sample eLink to Application Adapter, and a Sample E-mail Adapter.

This chapter discusses the following topics:

- Demo Prerequisites for UNIX

- The Sample Application to eLink Adapter

- The Sample eLink to Application Adapter

- The Sample E-Mail Adapter

Demo Prerequisites for UNIX

If you run the demos on a UNIX operating system, there are several prerequisites:

- Before building the demo, you must have GNU Make Version 3.74 or higher. If you do not have Make, you can download it from http\\www.gnu.org. Select the Software item and then scroll down to make.

- Check the machine entry in your elinkdo.mak and elinkdi.mak files by performing the following procedure:

  - Open the .mak file in a text editor.

  - Find the following line(s), which may be entered multiple times for multiple machines:

      ifeq ADK_MACHINE #, where # equals a machine ID per the following table.

      Table 5-1 UNIX Machine ID Numbers

      ####

      Operating System | ID #
      --- | ---
      AIX 4.3 | 49
      Compaq Tru64 UNIX 5.0 | 37
      HP-UX 10.20 | 36
      HP-UX 11.0 | 40
      Solaris | 35

  - Verify that the information under the machine ID line is correct for the identified operating system. If it is not correct, change the information to reflect your system configuration.

  - Save the edited .mak file.

The Sample Application to eLink Adapter

The Sample Application to eLink Adapter provides an example of the general form of an application to eLink adapter. In particular, it provides an example of using a Tuxedo daemon service to poll an external source for requests. In the case of the Sample Application to eLink Adapter, the external source is just a text file that contains request strings. The Sample Application to eLink Adapter also provides a complete example of the use of FML32. At this time, the Sample Application to eLink Adapter does not provide a complete code example of an adapter because it does not read information from a configuration file, it does not use the standard eLA_log() function provided for logging message by adapters, and it does not check a license file. For a more complete code example of an adapter, see the Sample eLink to Application Adapter.

Before installing and running the Sample Application to eLink Adapter, you must install Tuxedo.

Configuring the Sample Application to eLink Adapter

To configure the Sample Application to eLink Adapter:

1. Edit SETENV.BAT for NT, or setenv.sh for Unix to reflect your environment.

   Note: For NT, Tuxedo sets TUXDIR and adds TUXDIR\bin to the PATH environment variable. For Unix, Tuxedo generates a TUX.ENV file that sets these variables for you.

   You need to set the INCLUDE, LIB, APPDIR, TUXCONFIG, FIELDTBLS32, and FLDTBLDIR32 variables on both NT and Unix, and the SHLIB_PATH (or LD_LIBRARY_PATH or LIBPATH) variable on Unix.

   Make sure that each of the following variables is set correctly:

   - TUXDIR=<Base directory of the Tuxedo software>

   - APPDIR=<Base directory of the sample application>

   - PATH must include $TUXDIR/bin

   - TUXCONFIG=<Full pathname of the binary tuxconfig file>

   - FLDTBLDIR32=<Base directory of the sample application>

   - FIELDTBLS32=table.fml (FML32 table for this application)

   - LD_LIBRARY_PATH must include $TUXDIR/lib on systems that use shared libraries (except HP-UX and AIX).

   - SHLIB_PATH (HP-UX only) must include $TUXDIR/lib

   - LIBPATH (AIX only) must include $TUXDIR/lib

   - ADK_MACHINE must be set to the appropriate machine ID # as referenced in Table 5-1

2. Execute SETENV.BAT for NT, or setenv.sh for Unix to complete the installation.

Building and Running the Sample Application to eLink Adapter

At this point, you are ready to build and run the Sample Application to eLink Adapter included in ADKDEMO\INBOUND.

1. Because the sample inbound adapter runs as a Tuxedo server and the imitation third-party "software" is just a file that is used for input, there is no Tuxedo client to build, but there are two servers that must be built.

   To build the servers, execute:

   make -felinkdi.mak

   or use the commands:

   buildserver -o simpserv -f simpserv.c -s TOUPPER
   buildserver -o inbound -f inbound.c -s DAEMON

   Note: For NT, the default compiler is the MS VC++ command line compiler, CL.EXE. While the compiler can be changed by setting the CC environment variable, there is no guarantee that the .LIB files supplied with either Tuxedo or the ADK will work with any other compiler.

2. Edit the ubb.inbound file. The APPDIR, TUXDIR and TUXCONFIG variables need to be set independently of external variables. Be sure that the variables set in the ubb.inbound file match your environment variables. The machine ID field must also be set. The machine ID field on Windows NT (in this instance DALNT10) should be entered in upper case.

3. Execute tmloadcf with ubb.inbound as an argument. This converts the ubb.inbound text file into a binary TUXCONFIG file.

   tmloadcf -y ubb.inbound

4. Execute tmboot to load the ADKDEMO inbound application.

   tmboot -y

   The demo inbound server is booted and runs until it has processed all requests in the file input.txt. The outputs are written to stdout.

5. Execute tmshutdown to shut down the ADKDEMO inbound application.

The Sample eLink to Application Adapter

Before installing and running the Sample eLink to Application Adapter, you must install Tuxedo and the ADK.

Configuring the Sample eLink to Application Adapter

To configure the Sample Application to eLink Adapter:

1. Edit SETADK.BAT for NT or SETADK.SCR for Unix to reflect your environment.

   Note: For NT, Tuxedo sets TUXDIR and adds TUXDIR\bin to the PATH environment variable. For Unix, Tuxedo generates a TUX.ENV file that sets these variables for you. You need to set the INCLUDE, LIB, APPDIR and TUXCONFIG variables on both NT and Unix, and the SHLIB_PATH variable on Unix.

2. Execute SETADK.BAT for NT or SETADK.SCR for Unix to complete the installation.

Building and Running the Sample eLink to Application Adapter

At this point, you are ready to build and run the sample eLink to application adapter included in ADKDEMO.

1. Build the client and server as appropriate for your operating system:

   - For NT, execute MAKECLIENT.BAT and MAKESERVER.BAT.

   - For Unix, enter make -felinkdo.mak or execute MAKECLIENT.SCR and MAKESERVER.SCR.

     These batch or script files invoke BUILDCLIENT and BUILDSERVER to build DEMOCLIENT.EXE and ADKDEMO.EXE. No changes should be required as long as BUILDSERVER, BUILDCLIENT and your C compiler can be found.

     Note: For NT, the default compiler is the MS VC++ command line compiler, CL.EXE. While this compiler can be changed by setting the CC environment variable, there is no guarantee that the .LIB files supplied with either Tuxedo or the ADK will work with any other compiler.

2. Edit the ADKDEMO.UBB file for NT or ADKDEMOX.UBB file for Unix. The APPDIR, TUXDIR and TUXCONFIG variables need to be set independently of external variables. The machine ID field on NT (in this instance DALNT10) should be entered in upper case.

   Note: The ADKDEMO.CFG file referenced by both UBB files need not be edited, because it is installation independent.

3. Execute tmloadcf with the appropriate UBB file as an argument to convert the UBB text file into a binary TUXCONFIG file.

4. Execute tmboot to load the ADKDEMO application.

5. Run DEMOCLIENT with a variety of arguments to exercise the server.

6. Execute tmshutdown to shut down the ADKDEMO application.

The Sample E-Mail Adapter

The Sample E-Mail Adapter is an eLink to application adapter that consists of a Tuxedo client and server. The E-Mail Adapter's SEND service allows a user to connect to an SMTP Server to send an E-Mail. The RECEIVE service is not implemented so you must add the functionality to connect to a POP3 server to receive E-Mail.

The E-Mail client uses the contents of the email.cfg file to send information to the E-Mail server. The email.cfg file contains the following information in the form of field name = field contents. Edit the .cfg file with information appropriate for your system.

server=your.SMTPServer.com
domain=your.SMTPDomain.com
sender=sender@email.com
recipient=recipient@email.com
subject=message subject
file=emailmessage.txt

When the E-Mail client is invoked, it reads the E-Mail information from the email.cfg file, puts the .cfg file fields into an FML32 buffer, and then sends that buffer to the E-Mail server. When the server receives the E-Mail buffer, it processes the buffer and uses emailtools to configure the message and send it to the specified SMTP server. When the server receives confirmation that the message was sent, the server returns the FML32 buffer back to the E-Mail client and the process terminates.

Invoking the Sample E-Mail Adapter

Invoke the Sample E-Mail Adapter with a command line in the following format:

>     $ emailclient <service> [ -f email.cfg ])

For example, to invoke the Sample E-Mail Adapter using default information contained in the email.cfg file, use the following entry for UNIX:

>     $ emailclient send -f email.cfg

For Windows NT, enter the command at the appropriate directory prompt:

>     C:\emailclient send -f email.cfg

Or, to invoke the Sample E-Mail Adapter using your own information rather than using parameters specified in the email.cfg file, enter the emailclient command without specifying the .cfg file as the following UNIX example shows:

$ emailclient send

After submitting the command, you will be prompted to enter the following parameters, where the text in brackets equals the parameter values that you wish to use:

>     Enter Enter SMTP server (your.SMTPServer.com)=[your SMTP server]
>     Enter SMTP domain (your.SMTPDomain.com)=[your SMTP domain]
>     Enter Recipient of email (recipient@email.com)=[your recipient's E-Mail address]
>     Enter Sender's email (sender@email.com)=[your sender's E-Mail address]
>     Enter Subject of email=[your message subject]
>     Enter file loacation of message=[your emailmessage.txt]

Configuring the Sample E-Mail Adapter

To configure the Sample E-Mail Adapter:

1. Edit SETADK.BAT for NT or SETADK.SCR for Unix to reflect your environment.

   Note: For NT, Tuxedo sets TUXDIR and adds TUXDIR\bin to the PATH environment variable. For Unix, Tuxedo generates a TUX.ENV file that sets these variables for you. You need to set the INCLUDE, LIB, APPDIR, ADKDIR, ADK_MACHINE, and TUXCONFIG variables on both NT and UNIX, and the SHLIB_PATH on HP-UX, LIBPATH on AIX, and LD_LIBRARY_PATH on all other UNIX platforms.

2. Execute SETADK.BAT for NT or SETADK.SCR for Unix to complete the installation.

Building and Running the Sample E-Mail Adapter

At this point, you are ready to build and run the sample E-Mail Adapter.

1. Build the client and server as appropriate for your operating system:

   - For NT, execute MAKECLIENT.BAT and MAKESERVER.BAT.

   - For Unix, enter make -f emaildemo.mak or execute MAKECLIENT.SCR and MAKESERVER.SCR.

     Note: The GNU Make Utility is used for the make function. Refer to Demo Prerequisites for UNIX for more information about GNU Make.

     These batch or script files invoke BUILDCLIENT and BUILDSERVER to build EMAILCLIENT.EXE and EMAILSERVER.EXE. No changes should be required as long as BUILDSERVER, BUILDCLIENT and your C compiler can be found.

     Note: For NT, the default compiler is the MS VC++ command line compiler, CL.EXE. While this compiler can be changed by setting the CC environment variable, there is no guarantee that the .LIB files supplied with either Tuxedo or the ADK will work with any other compiler.

2. Edit the EMAILDEMO.UBB file for NT or EMAILDEMOX.UBB file for Unix. The APPDIR, TUXDIR and TUXCONFIG variables need to be set independently of external variables. The machine ID field on NT (in this instance DALNT10) should be entered in upper case.

   Note: The EMAILSERVER.CFG file referenced by both UBB files need not be edited, because it is installation independent.

3. Execute tmloadcf with the appropriate UBB file as an argument to convert the UBB text file into a binary TUXCONFIG file.

4. Execute tmboot to load the EMAILSERVER application.

5. Run EMAILCLIENT with a variety of arguments to exercise the server.

6. Execute tmshutdown to shut down the EMAILSERVER application.

Copyright © 2000 BEA Systems, Inc. All rights reserved. Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.