Table of Contents Previous Next PDF

Using the Workstation Component

Using the Workstation Component
The following sections describe using the Oracle Tuxedo ATMI Workstation component on both Windows and UNIX systems:
Writing Client Programs
You can develop client programs targeted for workstations in the same way that you develop client programs within the Oracle Tuxedo system administrative domain (that is, native clients). With a few exceptions, all ATMI and FML functions available to the native client are also available to the Workstation client.
tpadmcall() is an example of an ATMI function that is available to the native client but not to the Workstation client.
Interoperability Restrictions for Workstation Clients
Interoperability between Oracle Tuxedo release 7.1 or later Workstation clients and applications based on pre-7.1 releases of the Oracle Tuxedo system is supported in any of the following situations:
An Oracle Tuxedo release 7.1 or later Workstation client with multiple threads in a single context cannot interoperate with a pre-7.1 release of the Oracle Tuxedo system.
Building Client Programs
You compile and link-edit Workstation client programs using the buildclient(1) command. If you are building a Workstation client on a native node (that is, one on which the complete Oracle Tuxedo system is installed), use the -w option to indicate the client should be built using the workstation libraries. Otherwise, on a native node, where both native and workstation libraries are present, the default is to use the native libraries. In this case, using the -w option ensures that the correct libraries for a Workstation client are used. On a workstation, where only the workstation libraries are present, it is not necessary to use the -w option.
The following listing shows an example of the buildclient(1) command line on a native node.
Listing 2‑1 buildclient Command Line
TUXDIR=/var/opt/tuxedo CC=ncc; export TUXDIR CC
buildclient -w -o wsclt -f wsclt.c -f “userlib1.a userlib2.a”
The -o option provides a name for your output file. Input files are specified with the -f firstfiles option to indicate that they are link-edited before system libraries. As indicated in the example, you must define the TUXDIR environment variable to ensure that the buildclient command can locate system libraries. CC defaults to cc but can be set to another compiler, as shown in the example.
See Also
“Writing Clients” in Programming an Oracle Tuxedo ATMI Application Using C and Programming an Oracle Tuxedo ATMI Application Using COBOL
“COBOL Language Bindings for the Workstation Component” in Programming an Oracle Tuxedo ATMI Application Using COBOL
“Writing Security Code So Client Programs Can Join the ATMI Application” in Using Security in CORBA Applications
buildclient(1) in Oracle Tuxedo Command Reference
Using Oracle Tuxedo System-Supplied Clients
wud and wud32 are Oracle Tuxedo system-supplied driver programs provided for workstations. These driver programs are based on the standard Oracle Tuxedo client programs, ud and ud32, that have been built using the workstation libraries.
Use wud(1) to send FML buffers to Oracle Tuxedo system servers. Use wud32 with fielded FML32 buffers of type FBFR32.
Using wud in a Security Application
If wud is run in a security application, it requires an application password to access the application. If standard input is from a terminal, wud prompts the user for an application password. If you are running the client program from a script, which is a common occurrence with wud, the password is retrieved from the environment variable APP_PW. If this environment variable is not specified and an application password is required, then wud fails.
Do not confuse the APP_PW environment variable with the similar configuration file parameter, SECURITY, for which the value APP_PW enables the security feature.
See Also
ud, wud(1) in Oracle Tuxedo Command Reference
Running Oracle Tuxedo System Clients on a Workstation
After the client programs have been developed and tested, they can be moved to the workstations where they will be available to users.
Verifying the Directory Structure on Workstation Clients
The following table describes the directory structure on a Workstation client after you have installed the Workstation component of the Oracle Tuxedo system.
Contains copylib entries for use in COBOL programs.
Setting Environment Variables
Workstation clients make use of several environment variables. The following table shows the environment variables that are checked by tpinit(3c) or TPINITIALIZE(3cbl) when the Workstation client attempts to join the application. For details on setting these environment variables, see “Defining Workstation Clients” in Setting Up an Oracle Tuxedo Application.
When the workstation machine receives an MBSTRING buffer, and assuming another environment variable named TPMBACONV is set, the code-set encoding name defined in TPMBENC is automatically compared to the code-set encoding name in the received buffer; if the names are not the same, the MBSTRING buffer data is automatically converted to the encoding defined in TPMBENC before being delivered to the Workstation client.
TPMBENC has no default value. For a Workstation client using MBSTRING typed buffers, TPMBENC must be defined on the workstation machine.
TPMBENC is used in a similar way for FLD_MBSTRING fields in an FML32 typed buffer.
Specifies whether the workstation machine running Oracle Tuxedo 8.1 or later automatically converts the data in a received MBSTRING buffer to the encoding defined in TPMBENC. By default, the automatic conversion is turned off, meaning that the data in the received MBSTRING buffer is delivered to the Workstation client as is—no encoding conversion. Setting TPMBACONV to any non-NULL value, say Y (yes), turns on the automatic conversion.
TPMBACONV is used in a similar way for FLD_MBSTRING fields in an FML32 typed buffer.
Applies only if URLENTITYCACHING=Y (yes) or is not set; for details, see the description of URLENTITYCACHING in this table.
Specifies the directory in which the workstation machine running Oracle Tuxedo 8.1 or later caches DTD, schema, and entity files; specifically, where the Apache Xerces-C++ parser running on the Workstation client caches the DTD, XML schema, and entity files. The URLENTITYCACHEDIR variable specifies the absolute pathname for the cached files. If URLENTITYCACHEDIR is not specified, the default directory becomes URLEntityCachedir, which will be created in the current working directory of the Workstation client process provided that the appropriate write permissions are set.
The network address used by the Workstation client when connecting to the workstation listener or workstation handler. This variable, along with the WSFRANGE variable, determines the range of TCP/IP ports to which a Workstation client will attempt to bind before making an outbound connection. This address must be a TCP/IP address.
Maximum amount of core memory that ATMI functions use for buffering application replies before they are dumped to disk. Used by tpinit(3c) and TPINITIALIZE(3cbl). Replies obtained using tpgetrply(3c), TPGETRPLY(3cbl), and unsolicited messages are buffered in this area. When this area is filled with one or more messages, the overflow is written to a disk file. The system default limit is 256,000 bytes. Whether you use WSRPLYMAX to set a lower limit depends on the amount of available memory on your machine. Writing replies to disk causes a substantial reduction in performance.
Workstation type. Used within tpinit(3c) and TPINITIALIZE(3cbl) when invoked by a Workstation client to negotiate encode/decode responsibilities with the native site. If you do not specify WSTYPE, the system performs encoding, even if it is also unspecified on the native site.You must explicitly specify the same WSTYPE value for both sites to ensure that the encode/decode feature is turned off.
Other environment variables may be needed by Workstation clients on a UNIX workstation depending on the Oracle Tuxedo system features being used. Reference page compilation(5) in Oracle Tuxedo File Formats, Data Descriptions, MIBs, and System Processes Reference explains which variables are needed under what circumstances.
Creating an Environment File
If you have created an environment file, it is read when tpinit(3c) or TPINITIALIZE(3cbl) is called. The following listing shows a sample file that could be used for two different applications.
Listing 2‑2 Environment File
;this is a comment
/* this is a comment */
#this is a comment
//this is a comment
set FIELDTBLS=app1_flds
set FLDTBLDIR=/opt/app1/udataobj
The format of the file is as follows:
set variable=value
where variable must begin with an alphabetic or underscore character and contain only alphanumeric or underscore characters, and value may contain any character except newline.
Within the value, strings of the form ${env} are expanded using variables already in the environment. Forward referencing is not supported and if a value is not set, the variable is replaced with the empty string. Backslash (\) may be used to escape the dollar sign and itself. All other shell quoting and escape mechanisms are ignored and the expanded value is placed into the environment.
where label is the name of the section and follows the same rules for variable above. The label is silently truncated if longer than 31 characters.
Variable lines between the top of the file and the first label are put into the environment for all applications; this is the global section. A label of [] also indicates the global section. Other variables are put into the environment only if the label matches the application label specified for the application.
Using tuxreadenv
When you call the tuxreadenv(3c) function, it reads the environment file and adds the environment variables to the environment for the entire process, independent of platform. These variables are available using tuxgetenv(3c) and can be reset using tuxputenv(3c).
void tuxreadenv(char *file, char *label)
If file is NULL, then a default filename is used. The default filenames for various platforms are as follows:
If the value of label is NULL, then only variables in the global section are put into the environment. For other values of label, the global section variables plus any variables in a section matching the label are put into the environment.
An error message is printed to the userlog under the following conditions:
Each time tpinit(3c)is called (either explicitly or implicitly by calling another ATMI function), tuxreadenv(3c) is called automatically in Workstation clients. If WSENVFILE is set in the environment, then it designates the environment file; otherwise, NULL is passed to tuxreadenv() for the filename so that the default file is used. If WSAPP is set in the environment, then it is to be used as the section label in the environment file; otherwise, NULL is passed to tuxreadenv() for the label name. Application clients may also call tuxreadenv() explicitly.
The environment is implemented and available in different ways on different platforms. A uniform interface to the environment is provided via the existing tuxgetenv(3c) and tuxputenv(3c) functions. These functions provide access to the following:
All variables from the specified WSENVFILE file for the specified WSAPP label (or the defaults if not specified)
See Also
tpinit(3c) in Oracle Tuxedo ATMI C Function Reference
tuxreadenv(3c) in Oracle Tuxedo ATMI C Function Reference
How a Multithreaded or Multicontexted Workstation Client Joins an Application
To join an Oracle Tuxedo application, a multithreaded Workstation client must always call tpinit() with the TPMULTICONTEXTS flag set, even if the client is running in single-context mode.
See Also
tpinit(3c) in Oracle Tuxedo ATMI C Function Reference

Copyright © 1994, 2017, Oracle and/or its affiliates. All rights reserved.