BEA Logo BEA eLink Adapter Development Kit Release 1.1

  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

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

 


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:

  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:

  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:

  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.