Creating an ASE Web Service Consumer

In the Enterprise Explorer, you can map a Web service definition to one or more proxy tables in an Adaptive Server Enterprise database, then use the proxy tables to define queries and SELECT statements. You can also use proxy tables that have already been defined in the database.

Prerequisites 

Enable the Web Services feature for your database.

This feature uses the Web Services Consumer component in Adaptive Server 12.5.x and later.

The Web Services as Tables folder at the top level of an Adaptive Server Enterprise connection profile in the Enterprise Explorer view displays all proxy tables that have been mapped from Web service definitions in the current database. From the pop-up menu, you can map a new Web service to one or more proxy tables and refresh the view of proxy tables in the database.

  1. Right-click the Web Services As Tables folder in an Adaptive Server Enterprise connection, and select Map Web Service to Tables from the context menu.

    The Select WSDL dialog helps you find a WSDL file from which to create the proxy table.

  2. In the dialog, you can enter or browse for the name or the URL of a WSDL file, or you can search for a Web service using UDDI registries.
    Note: To enter and use a local WSDL file, EAServer must also be local.

    When you complete the wizard, the Web Services Consumer maps the Web methods in the WSDL file to tables. Each proxy table contains a Columns folder, which in turn contains column objects that represent the input and output parameters of the Web service method that corresponds to the proxy table. The new proxy tables display in the Web Services as Tables folder in the Enterprise Explorer view, and in the Select Tables dialog box in the SQL Query Editor and Visual SQL.

Example


  1. In the Select WSDL dialog, select From URL.

  2. Enter http://www.xmethods.net/sd/2001/TemperatureService.wsdl and click OK.

    The proxy table is added to the Web Services as Tables folder.

  3. To use the proxy table in a query:


    1. From the SQL File Editor toolbar, click the Select statement toolbar button.

    2. Select "getTemp" from the Select Tables dialog.

    3. Select "Return" in the table displayed in the Table Layout view.

    4. In the Where view, define a condition with "_zipcode" on the left side (Column) and enter a value such as 80303 on the right side (value).

    5. Click the Execute toolbar button to execute the query.

Next 

There are some restrictions on the use of proxy tables in defining queries and SQL statements. For a complete description of the restrictions that apply to the use of proxy tables, see the Web Services User's Guide in the Adaptive Server Enterprise documentation set included with Sybase WorkSpace.

Related tasks
Creating a Database Service from a Stored Procedure


Created June 25, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com