How Do I: Create a Tuxedo Control

In this task you will create a Tuxedo Control file and then add a method to the control file.

  1. Right-click inside the web service (Source view or Design view) in which you want to use a Tuxedo service and select Insert > Control.
  2. From the Select Control menu, choose New System Control > Tuxedo Control. The New Control dialog displays.
    Select a location and name for the control and click Next. Note: The Tuxedo Control you create must be in a folder within the project.

  3. image

    The next page of the wizard allows to enter control properties.

    alt

  4. Specify the following Tuxedo service attributes:
  5. Tuxedo Control Field
    Description
    Service Name

    Type the WTC imported service name. This name should match the service name that is mapped in Create a WebLogic Tuxedo Connector (WTC) Service.

    If you are not sure of the service name, you can click Browse and a list of imported WTC service names display. If the service is listed in the WTC Imported Services dialog, you can select it and click Select. If the service you want is not listed, then the service has not been imported into WebLogic Server.

    To import a service from the WTC Imported Services dialog, click Import and the Workstation Address dialog displays.

    Note that this field corresponds to the annotation attribute: @tuxedo(serviceName).

    For information about importing WTC services, see Import New Tuxedo Services.

    Service Type

    Select the type of service from the menu. This specifies the type of interaction that the Tuxedo Control supports in the Tuxedo service.

    Possible values are:

    The default is service.

    This field corresponds to the annotation attribute @tuxedo(serviceType).

    Buffer Type

    Select the type of buffer from the menu. This specifies the type of buffer that the Tuxedo Control will construct to send to the Tuxedo service.

    Possible values are:

    • Carray used when the data is an unspecified array of characters (byte array), any of which can be null. Tuxedo equivalent: CARRAY.
    • FML used when the data contains named fields of simple types each with a maximum length of 65 K bytes.
    • FML32 used when the data contains named fields including nested FML32 fields each having a maximum length of 4 GB.
    • String used when the data contains a simple string as its only contents.
    • View used to define C or COBOL structures for a Tuxedo application and to define an equivalent Java TypedView buffer for a WebLogic application. A view description file in which the fields and types that appear in the data structure are defined, must be available to client and server processes that use a data structure described in a VIEW typed buffer. Encoding and decoding are performed automatically if the buffer is passed between machines of different types.
    • View32 is equivalent to VIEW but uses 32 bits for length and count fields, which allows for larger and more fields.
    • XML used when data is an XML document. Data input to methods must be in the form of a Java String or an XML Bean. Tuxedo equivalent: XML for Tuxedo Release 7.1 and higher.
    • Note: For input XML using data dependent routing, remove all comments generated by the Workshop test browser in the XML buffer. Depending on the location of the comments in the buffer, Tuxedo may have problems parsing the buffer.

    • XCOMMON is a synonym for the view buffer type. An XCOMMON buffer is represented by a Java class extending the TypedXCommon class. It is identical in semantics to a view buffer.
    • XCTYPE is a synonym for the view buffer type. An XCTYPE buffer is represented by a Java class extending the TypedXCType class. It is identical in semantics to a view buffer.
    • XOCTET is simply a byte array and is a synonym for the CARRAY buffer type in Tuxedo.
    • none used when no input buffer is to be used in the request to the Tuxedo service. If the method signature contains input parameters, an error is generated.
    • unknown

    The default is none.

    Note that this field corresponds to the annotation attribute: @tuxedo(bufferType).

       

    Field Tables

    Type the name of the field table for the Tuxedo service when using fml or fml32 buffers. You should specify the field table when using fml or fml32 buffers that are sent or act as reply buffers from the called service. The name of the field table should match the classes generated with the mkfldclass or mkfldclass32 utilities.

    For buffer types fml and fml32, WTC needs the names and types of the fields the buffer can contain. These are described in field table classes created with mkfldclass and mkfldclass32 utilities.

    For more information about mkfldclass and mkfldclass32 utilities, see WebLogic Server Javadoc.

    Note that this field corresponds to the annotation attribute: @tuxedo(fieldTables).

    Return View Classes

    Type the names of the view classes that correspond to the view buffer types that can be received from the Tuxedo service. This field is only required when the Tuxedo service returns a view or view32 buffers. These classes are independent from the Send View Class attribute which is used to specify the view or view32 class that represents the view buffer the Tuxedo service expects as an input.

    Note: The value of this attribute may be a list of classes so that a single Tuxedo service can respond with different VIEW buffers.

    For information about viewj and viewj32 utilities, see WebLogic Server Javadoc.

    Note that this field corresponds to the annotation attribute: @tuxedo(viewClasses).

    Send View Class

    If you have selected view or view32 in the Buffer type field, the Send View Class field becomes active. This attribute provides the name of the class that represents the view/view32 buffer the service is expecting as an input buffer. This view class is used to create the TypedView buffer.

    Note that this field corresponds to the annotation attribute: @tuxedo(sendViewClass).

  6. Click Finish. The new Tuxedo Control displays in the Design view.
  7. In Design view, double-click the image of the newly created Tuxedo Control.
  8. The new Tuxedo Control file displays in Source view.
  9. Click the Source view tab. Edit the signature of this method to match the buffer contents expected for the Tuxedo service being called.
  10. When using the Insert Wizard to create a new Control, a single method is defined that corresponds to the Service Type and Service Name specified in the Insert Wizard. The signature and possibly the name of this method needs to be edited to match the name and buffer contents expected for the Tuxedo service being called. In addition, any other services that this control calls must have methods defined for them in this interface.

    For information about mapping data and fields to create request/response buffers, see How Do I: Map Java Data Types/FML and VIEW Buffers.

  11. Select File > Save from the menu.
  12. Press Ctrl+w to close the Tuxedo Control file.

Import New Tuxedo Services

Within the web service or Java application, you can browse available Tuxedo services from the New Control dialog. In the Service Name or Receive Queue Space fields, you can click Browse and see a list of available WTC imported services. If the service you want is not in the list, then the service has not been imported into WebLogic Server.

Note: Before you can import the service to WebLogic Server, you must configure the WTC service. To configure a WTC service, click Configure on the WTC Imported Services dialog box. (Note that the Configure button will be greyed out if a WTC connection is already present.) Refer to How Do I: Configure a WTC Service.

To import a service from the WTC Imported Services dialog, click Import and the Workstation Address dialog displays.

image

  1. Enter the network address of the workstation listener on a remote Tuxedo domain, such as a machine_name:port number combination //mach1:5100. This is the address of the Tuxedo application so the service names can be retrieved. Click Next.
  2. Note: when you click Next on the Workstation Address dialog, if the Tuxedo domain has security turned on, the Security Information for Tuxedologin dialog displays. Enter the Tuxedo application information and click Next.

A connection to the Tuxedo domain is made and a list of services exported by the Remote Tuxedo Domain displays.

  1. Select the services to import. If there is more than one local WTC domain configured in WebLogic Server, then the list of local domains configured displays and you can select the local domain that offers this service. Click Import to create the associated import services.
  2. If you click Back, the WTC Imported Services dialog displays.

For more information about importing WTC services, see "Setting Up a WebLogic Tuxedo Connector (WTC) Connection."