CRUD Usage of a Tamino Doctype as a Web Service

Tamino provides a plugin wizard that supports the creation, reading, updating and deleting (often referred to as "CRUD") of XML documents via a web service. The wizard generates a doctype web service archive that can subsequently be processed either manually or by means of the Software AG Web Services Stack (WSS).

The following topics are discussed in this document:


Setting Preferences

Before using the wizard to generate a web service archive, you can set preferences that specify its behavior. There are two sets of preferences:

Database Selection

In a later step, the doctype web service wizard prompts you to select a Tamino database from a selection list. In order to populate the selection list, proceed as follows.

In Eclipse, choose Window > Preferences. Then, in the navigator tree, select Software AG > Tamino > Tamino Database List. The list of Tamino databases available for selection is displayed, as shown in the following screenshot:

graphics/webser_01.png

You can now use the Add..., Edit... and Remove functions to modify the selection list as required.

Note:
In order to generate a web service successfully, the database selection list must contain at least one entry.

DocType Web Service Preferences

In Eclipse, choose Window > Preferences. Then, in the navigator tree, select Software AG > Tamino > DocType Web Service. The list of preferences for the Tamino doctype web service wizard is displayed, as shown in the following screenshot:

graphics/webser_09.png

The following paragraphs describe the available preferences.

Select Tamino database via URL

This switch specifies whether the database selection list that appears in subsequent wizard screens should display the names of the databases or their URLs.

Default: The database selection list displays the databases by name.

Show system collections

This switch specifies whether Tamino system collections are included in the list of collections from which you can select.

Default: Do not include the Tamino system collections.

Display generated XQuery module

This switch specifies whether the XQuery module that is generated by the wizard should be shown to the user; if this switch is selected, the user is also given the opportunity of saving the XQuery module in the file system.

Default: Do not display the XQuery module.

Display generated WSDL

This switch specifies whether the WSDL file that is generated by the wizard should be shown to the user; if this switch is selected, the user is also given the opportunity of saving the WSDL file in the file system.

Default: Do not display the WSDL file.

Select the destination of the generated service archive

This specifies whether the generated service archive should be stored to a user-specified file system location, or in an Eclipse project (where it can be further processed by means of the Software AG Web Services Stack). You can also specify the name of the desired Eclipse project here.

Default: Store the generated service archive in an Eclipse project named DocTypeWebService-Archives.

Using the Wizard

The DocType Web Service wizard plugin runs in your Tamino Eclipse environment. To start the wizard, choose File > New > Other; then, in the tree view, select Software AG > Tamino > DocType Web Service, as shown in the following screenshot:

graphics/webser_10.png

Choose Next. The DocType Web Service wizard starts, and displays a page from which you can select a Tamino database from the pulldown database list, which was constructed using the preferences as described above:

graphics/webser_11.png

The next screen lists the collections contained in the selected Tamino database that have a schema, as shown in the example below:

graphics/webser_12.png

Select the desired collection. The wizard now lists all the doctypes that are contained in the selected collection:

graphics/webser_13.png

Select the desired doctype. The wizard suggests a default name for the web service that will be generated, but you can overwrite it:

graphics/webser_14.png

The next steps depend on the settings on the preferences Display generated XQuery module and Display generated WSDL, which were specified above. If one or both of these options were selected (i.e. checked/ticked), the next screens display the generated XQuery module and/or the generated WSDL. You can use the Save As button to save the generated XQuery module and/or the generated WSDL to the file system, as shown in the example below.

graphics/webser_15.png

graphics/webser_16.png

Finally, pressing the Finish button adds the generated XQuery module to the Tamino database, and generates the web service archive, either at a selected file system location or in the Eclipse project as shown below, according to the preferences described above.

graphics/webser_17.png

Using the Generated Web Service

After the web service archive has been generated and written to the Eclipse archive, you can use the Software AG Web Services Stack (WSS) to process it further. In the Eclipse package explorer, double-click on the archive; this opens the Web Services Stack editor, where you can set some service properties, as shown below:

graphics/webser_18.png

For further details, please refer to the documentation of the Software AG Web Services Stack.

You can also use the Web Services Stack to deploy the generated web service, and to register it in CentraSite. These functions can be accessed from the archive context menu (right mouse button).