The Tuxedo control allows you to create a web service or Workshop application that uses one or multiple Tuxedo services in its business logic. The Tuxedo control is a generic interface. To use the control to communicate with specific Tuxedo services, you must create a control. The control consists of a Java interface and implementation file pair that tells the Tuxedo control the names of the Tuxedo services you want to invoke, the type of interaction the services require (service with reply, queued service, etc), and the Tuxedo buffer types the services expect as input. Your application invokes the methods defined by the control interface to invoke the Tuxedo services. After you create a control for a specific set of Tuxedo services, you can reuse the control in any application that needs to access those services. Workshop does most of the work of creating a control for you.
In this section, the example shown represents creating a web service.
To create a web service that uses a Tuxedo service:
Note: if you already have a web service project, you can add the Tuxedo Control facet by right-clicking the project and select Properties > Project Facets.
Create a new folder/package in the src dir.
Right-click the new folder and select New > WebLogic Web Service.
Controls act as interfaces between your web service and other data sources. Therefore, you want to add a Tuxedo control to your web service to provide your web service with access to Tuxedo services.
The tasks in this step are:
In this task you will use a Tuxedo Control file and then add a method to the control file.
WTC acts as a gateway between the Tuxedo environment and WebLogic environment; therefore, a WTC service definition must exist that maps to the Tuxedo service you want to use in your web service.
Import the Tuxedo service that you want to use in your web service. For information on how to import WTC services, see How Do I: Configure a WTC Service.
The Tuxedo control provides the following public methods to use in your web service in addition to the methods defined by your control. If you want to use these methods you must call them explicitly.
Gets the WTC connection currently used by this control. This allows you to use more of the WTC APIs defined for a connection. getConnection() returns an instance of an ApplicationToMonitorInterface object that can be used to interact with Tuxedo through JATMI calls.
Note: This method will not allow you to terminate the connection or use tpacall with asynchronous calls.
Next you must incorporate one or more methods from the control just created in the previous step in your web service.
For the web service to provide additional processing before or after the call to the Tuxedo service or if the web service needs a different signature, click the Source view tab and edit the Java code as needed.
Next you will test your web service using debugger.