Skip navigation.

Administration Guide

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents Index View as PDF   Get Adobe Reader

Generating and Publishing Web Services

This chapter describes how to publish Liquid Data stored queries as Web Services. It contains the following sections:

Using the Administration Console, you can publish Liquid Data stored queries as Web Services. Web-based applications can then invoke Liquid Data queries as Web Service clients.

 


Viewing a Demo

Generate Web Service Demo... If you are looking at this documentation online, you can click the "Demo" button to see a viewlet demo showing how to use the Liquid Data Administration Console to generate a Web Service from a stored query. The viewlet also demonstrates how to test the generated Web Service in BEA WebLogic Workshop. The demo assumes that you have already stored the query you want to use in the Liquid Data Repository.

  

 


About Web Services

Web Services are a type of service that can be shared by, and used as components of, distributed Web-based applications. Web Services communicate with clients (both end-user applications or other Web Services) through XML messages that are transmitted by standard Internet protocols, such as HTTP. Web Services endorse standards-based distributed computing. Currently, popular Web Service standards are SOAP (Simple Object Access Protocol), WSDL (Web Services Description Language) and UDDI (Universal Description, Discovery, and Integration).

 


Creating a New Web Service from a Stored Query

This section describes how to generate a Web Service from a stored query in the server repository. For each stored query, you can have up to one generated Web Service.

Notes: The names of stored queries to be generated as Web Services must begin with an alphabetic character, followed by other alphabetic characters or numbers. The file name must also have an .xq suffix. For more information, see Naming Conventions for Stored Queries in Building Queries and Data Views.

To create a new Web Service from a stored query:

  1. In the left pane of the Administration Console, click the Liquid Data node.
  2. In the right pane, click the Stored Queries tab.
  3. In the list of queries in the Stored Queries tab, find the query with which you want to generate a Web Service.
  4. Click Generate Web Service for the query.
  5. Note: If the Generate Web Service link is not available, then a Web Service has already been generated for this stored query. Also, if the query does not have a schema already associated with it, you must configure one before the Generate Web Service link appears.


     
  6. When the Web Service generation is finished, a screen appears containing the URL of the WSDL file for the Web Service.
  7. Figure 23-1 Web Service Generation Success Screen

    Web Service Generation Success Screen


     

    The URL of the WSDL of a generated Web Service has the following pattern:

    http://HOSTNAME:PORT/liquiddata/query_name/webservice?WSDL

    For example, if the stored query is named order.xq, then the URL of its WSDL is http://localhost:7001/liquiddata/order/webservice?WSDL.

If the associated stored query is modified or deleted, then this generated Web Service is deleted automatically. If the stored query has been modified, you need to explicitly create it again using the instructions in this section.

 


Modifying a Web Service

You cannot directly modify a generated Web Service. If the associated stored query is modified or deleted, the generated Web Service is deleted automatically.

To modify a Web Service:

  1. Delete the Web Service according to the instructions in Deleting a Generated Web Service.
  2. Regenerate the Web Service according to the instructions in Creating a New Web Service from a Stored Query.

 


Deleting a Generated Web Service

You can delete a generated Web Service that you no longer need or that you want to regenerate.

Note: A Web Service is automatically deleted if its associated stored query is subsequently changed or deleted.

To directly delete a Web Service:

  1. In the left pane of the Administration Console, click the Liquid Data node.
  2. In the right pane, click the Repository tab.
  3. Click the web_services_gen directory.
  4. Scroll to find the Web Service that you want to delete.
  5. Click the delete icon next to the Web Service you want to delete.

 


Testing a Generated Web Service

You can use WebLogic Workshop to test a Web Service that you have generated with the Administration Console.

To test the Web Service:

  1. Start WebLogic Workshop.
  2. Create a Web Service Project in a WebLogic Workshop Application. (For example, select the top-level folder in the Application file tree, right-click, select New Project, and choose Web Service as the project type.)
  3. Create a folder in your Web Service Project.
  4. Right click the folder and create a new Java Control.
  5. Select Web Service as the type of Java Control.
  6. Enter the WSDL URL in the Web Service Control wizard and click Create. Workshop generates the Java Control Extension (.jcx) file.
  7. Select the new Java Control Extension (.jcx) file, right-click, and select Generate Test JWS File. Workshop generates a Java Web Service (.jws) file.
  8. Select the new Java Web Service (.jws) file and click the test button to run the Web Service (or choose Debug —> Start from the menu).
  9. In the Test Form, click the startTestDrive button.
  10. On the next page, click the Continue This Conversation link.
  11. Click the Order button to run the order query in the Web Service.
  12. The response from the Web Service appears. The response is the results of the query returned from the Liquid Data server.

 


Managing the Deployment of a Generated Web Service

When you create a Web Service, the Administration Console automatically deploys the generated EAR file to all nodes in the currently active domain. If you subsequently need to manage this EAR file, such as undeploying or redeploying it:

  1. In the left pane, click Deployments->Applications.
  2. Select the EAR file from the list.
  3. Click the Deploy tab. For additional instructions, see Deploying Applications and Modules in the WebLogic Server documentation.

For detailed information about WebLogic Web Services, see Programming WebLogic Web Services in the WebLogic Server documentation.

 


Finding the Target Schema for a Generated Web Service

If you want to find the target schema for a generated web service, the target schema is stored in the generated EAR file. To view the contents of the EAR file, open the file with a utility such as WinZip. The EAR file is located in the following directory:

<ld_repository>/web_services_gen

The filename of the EAR file is generated based on the filename of the stored query from which the web service was generated. For example, if a stored query is named order.xq, the generated web service name is order.ear.

 


Invoking Published Web Services

You invoke Liquid Data Web Services that were generated in the Administration Console using the same approach that you would use for invoking any WebLogic Web Service. For more information, see Invoking Queries in Web Service Clients in the Application Developer's Guide.

 

Back to Top Previous Next