Corporate Info | News | Solutions | Products | Partners | Services | Events | Download | How To Buy
WebLogic Tuxedo Connector ATMI Programmer's Guide: Previous topic | Next topic | Contents

Developing WebLogic Tuxedo Connector Service Applications

The following sections provide information on how to create WebLogic Tuxedo Connector service applications:

- Basic Service Application Operation

- Example Service Application

Basic Service Application Operation

A service application uses Java and JATMI primitives to provide the following tasks:

- Receive Client Messages

- Buffer Messages

- Perform the Requested Service

- Return Client Messages

Receive Client Messages

Use the TPServiceInformation class getServiceData() method to receive client messages.

Note: For more detailed information on the TPServiceInformation class, view the WebLogic Tuxedo Connector Javadoc by opening the index.html file in the doc directory of your WebLogic Tuxedo Connector installation.

Buffer Messages

Use the following buffer types when sending and receiving messages between your application and Tuxedo:

####

Table 3-1 TypedBuffers

Buffer Type | Description
--- | ---
TypedString | Buffer type used when the data is an array of characters that terminates with the null character. Tuxedo equivalent: STRING.
TypedCArray | Buffer type used when the data is an undefined array of characters (byte array), any of which can be null. Tuxedo equivalent: CARRAY.
TypedFML | Buffer type used when the data is self-defined. Each data field carries its own identifier, an occurrence number, and possibly a length indicator. Tuxedo equivalent: FML.
TypedFML32 | Buffer type similar to TypeFML but allows for larger character fields, more fields, and larger overall buffers. Tuxedo equivalent: FML32.
TypedXML | Buffer type used when data is an XML based message. Tuxedo equivalent: XML for Tuxedo Release 7.1 and higher.

Perform the Requested Service

Use Java code to express the logic required to provide your service.

Return Client Messages

Use the TuxedoReply class setReplyBuffer() method to respond to client requests.

Note: For more detailed information on the TuxedoReply class, view the WebLogic Tuxedo Connector Javadoc by opening the index.html file in the doc directory of your WebLogic Tuxedo Connector installation.

Example Service Application

The following provides an example of the TolowerBean service application which receives a string argument, converts the string to all lower case, and returns the converted string to the client.

Listing 3-1 Example Service Application

    .
    .
    .

    public Reply service(TPServiceInformation mydata) throws TPException {
         TypedString data;
         String lowered;
         TypedString return_data;

         log("service tolower called");

         data = (TypedString) mydata.getServiceData();
         lowered = data.toString().toLowerCase();
         return_data = new TypedString(lowered);

         mydata.setReplyBuffer(return_data);

         return (mydata);
    }
    .
    ..
    .
    .

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