Content starts here Generate a Web Services Mediator Client JAR File
This page last changed on Mar 11, 2008.

eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents

How To Generate a Web Services Mediator Client JAR File

This section explains how to generate a Web Services Mediator Client JAR file. This JAR is required by developers writing Java clients that access data services through web services using the Static Mediator API.

This section includes these topics: 

Overview 

To use the Static Mediator API in a web services-enabled client application, you must generate a Web Services Mediator Client JAR file. This JAR file contains the Static Mediator API interfaces, plus all the necessary SDO-compiled schemas for a dataspace.

One Java method is generated for each data service function that is mapped to a WSDL operation. Method names match the mapped WSDL operation name. Client developers access data service functions through the web service by calling these methods. If the web service requires message-level security, you can add a credential provider and trust manager through initial context properties. For more information on security, see Configure Security for Web Services Applications.

This topic explains how to generate a Web Services Mediator Client JAR file using these methods:

Tip: You can also generate a Mediator Client JAR using the Administration Console. See the ALDSP Adminstration Guide for details.

Using Studio

To generate a Web Services Mediator Client JAR file using Studio:

  1. Select File > Export.
  2. In the Export dialog, select AquaLogic Data Services Platform > Web Services Mediator Client JAR File, and click Next.
  3. Complete the Web Services Mediator Client JAR File dialog as follows, and click Finish.
  4. In the left panel, select the Dataspace project that contains the .ws file(s) to export. You can only export .ws files in one Dataspace project at a time. Checking/unchecking the checkbox next to a project or a folder automatically checks/unchecks all the sub-folders and .ws files under that project/folder.
  5. In the right panel, select the Web Service Map file to export. You can select one or more .ws files. To see and selectively check the .ws files in a sub-folder, you will need to expand and click on the folder on the left panel.  The message under the right panel shows the total number of .ws files currently checked for export.
  6. Specify a directory in which to place the exported JAR file. You can select any location on your system. You can use the dropdown list to select a recently specified directory or use the Browse button to locate one. By default, the exported JAR will be named: <data_space_name>-ws-client.jar.
  7. Unselect the Use default name checkbox if you want to enter a name for the JAR file.

The ALDSP Console view displays the export task status and any errors that may have occurred. You can click the Cancel button to cancel the export task before it has completed.

Using the Command-Line Tool

This section explains now to generate the Web Services Mediator Client JAR file using Ant and presents example Ant commands. Before using the command-line tool, be sure you have the following:

  • WSL 9.2 MP1 or MP2 installed with ALDSP installed in the default location BEA_HOME/aldsp_3.0.
  • A Dataspace project on your local filesystem that contains data service (.ds) and schema (.xsd) files. Miscellaneous IDE files within the project folder are allowed and will not affect the export.
  • Ant installed and in your path.

To generate the JAR file, run this Ant command:

ant -Dapproot=PROJECT_HOME -Dwslocator=locator -f BEA_HOME/aldsp_3.0/bin/sdo_dspclientgen.xml

Where:

  • PROJECT_HOME is the path to the Dataspace project. You must specify a full path for the values of BEA_HOME and PROJECT_HOME.
  • The locator option takes one of these values:
    • d:URI - Specifies a URI (or a semicolon-separated or space-separated list of URIs) to a .ws file in the Dataspace project from which to generate the JAR file. For example:
      ld:MediatorTestDataServices/CustomerWeb.ws
    • ALL - Generates the JAR for all .ws files in the dataspace.
       
      The result of executing this Ant script is a file named PROJECT-ld-client.jar in PROJECT_HOME, where PROJECT is the name of the directory PROJECT_HOME (as opposed to the full path to that directory).

Additional Ant Task Options

This section lists several optional features that you can use with the Ant tasks described in the previously:

  • Your environment must contain a WL_HOME environment variable, pointing to the WLS 9.2 installation. If it does not, you can provide an alternate by adding -Dwl.home=/path to specify the WLS root directory.
  • Your ALDSP 3.0 installation must be in the default directory BEA_HOME/aldsp_3.0. If it is not, you can provide an alternate by adding -Ddsp.home=/path to specify the directory.
  • To specify a full directory path for the output, add -Doutdir=/dirpath to the Ant command. You must provide an absolute path; a relative path, including ".", will not work, as it is assumed to be relative to PROJECT_HOME.
  • To specify a different name for the JAR file, add -Dsdojarname=name.jar.

Example 1

This example specifies multiple .ws files. The command must be entered on one line.

ant -Dapproot=/home/myprojects/myapp -Dwslocator='ld:MediatorTestDataServices/CustomerWeb.ws;
ld:MediatorTestDataServices/OtherCustomerWeb.ws' -f /home/bea/aldsp_3.0/aldsp_3.0/bin/sdo_dspclientgen.xml

Example 2

This example generates a JAR that includes all of the .ws files in the dataspace. The command must be entered on line line.

ant -Dapproot=/home/myprojects/myapp -Dwslocator=ALL -f /home/bea/aldsp_3.0/aldsp_3.0/bin/sdo_dspclientgen.xml
Document generated by Confluence on Apr 28, 2008 15:57