![]() |
![]() |
|
|
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:
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 |
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:
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:
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.
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.
tmloadcf -y ubb.inbound
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.
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:
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.
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.
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.
Note: The ADKDEMO.CFG file referenced by both UBB files need not be edited, because it is installation independent.
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:
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.
Building and Running the Sample E-Mail Adapter
At this point, you are ready to build and run the sample E-Mail Adapter.
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.
Note: The EMAILSERVER.CFG file referenced by both UBB files need not be edited, because it is installation independent.
![]() |
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|