Content starts here Generate a Web Service Map from a Data Service
This page last changed on Feb 26, 2008.

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

How To Generate a Web Service Map and WSDL from a Data Service

If you intend to access a data service through web services using the Data Services Mediator API, you must generate a web service map file first. A web service map file maps data service functions to web service operations. The map file is also used for setting and configuring security policies for web services applications.

Topics

Creating a Map File  

This section describes the basic steps that are required to create a map file. You can accomplish all of these tasks using the ALDSP Eclipse IDE. The procedure assumes that you have created or have access to the data service (.ds) file from which you want to create a data service.

Web Services Map File Reference

There are two ways to create a web service map file (.ws file):

Method 1: 

  1. Obtain access to the data space project containing the data service you wish to make accessible from a web service.
  2. Right-click on the data service name in Project Explorer and select Create Web Service Map. The map file (.ws file) is created with the same name as the data service file, and the map file is opened in the editor.

Method 2:

  1. Obtain access to the data space project containing the data service you wish to make accessible from a web service.
  2. Right-click on the data service name in Project Explorer and select:

    New > Web Service Map

  3. Use the dialog to create an empty web service map file with a name of your choosing (example: OrderService).
  4. Click Finish. The empty map file opens in the editor.
  5. Drag either an entire data service file onto the map file or drag individual data service operations

    Example: RetailApplication > OrderManagement > OrderService.ds

  6. Click OK. A file named OrderService.ws will be created. It will be located in the same folder as the source data service.
    Only the data service functions that are mapped in the map file are available to clients. Only public data service operations can be mapped.
    The following figure shows a data service file called OrderService.ds as the source for a map file called OrderService.ws (created using Method 2).
Adding a Data Service to a Web Services Map File

You can add additional public operations from other data services to the same web service map file.

Generating a WSDL File from Map File

To generate a WSDL file from a .WS file:

  1. Right-click on the .ws file.
  2. Choose Save WSDL As...
  3. Specify a name for the WSDL file.
  4. Click Save. Your new WSDL file should appear in the directory identified in the Save as dialog. 
  5. Double-click on the WSDL file to verify the soap service for the WSDL.
    A WSDL that has more than one schema section pointing to the same target namespace will result in validation errors with Eclipse WTP default WSDL validator.The WSDL generated in the above example is valid; however the project will indicate a validation error condition.

    The error condition will not interfere with your ability to build and deploy the project. Also, you can use the following Eclipse option settings to prevent the validation error report from displaying:
          1. Select the following option:
            Project > Properties > Validation
          2. Select Override validation preferences.
          3. Uncheck the Build option associated with the WSDL Validator.
          4. Click Apply, then OK.
          5. Select the following option:
            Project > Clean
          6. Click OK.

The validation error warnings should disappear.

Examining the Generated WSDL

You can examine the generated WSDL file. See Web Services Map File Reference for details.

Testing the Generated WSDL

You can test the generated WSDL file. See Web Services Map File Reference for details.

Modifying the Map File

 This section describes additional ways to add data services and operation to a map, and how to delete operations from an existing map.

Adding Data Services and Operations

You can drag and drop either an entire data service or individual data service operations from the Project Explorer onto an existing map file in the map file editor.

You can right-click in the map editor and select Add Data Services/Operations to Map. Use the Select Resources to Add to Map dialog to add data service resources to the map.

Deleting Data Services and Operations from a Map File 

To delete one or more operations, select the operations and right-click on the selected operations, and then select Delete.

To delete all operations that are related to a data service, right-click on the .ds dataservice box and select Delete. 

Renaming Mapped Operations

To rename a mapped operation, select the operation, right-click and select Rename Operation.  Then enter a new name for the mapped operation.

Document generated by Confluence on Apr 28, 2008 15:57