Oracle® HTML DB
Release 2.0
  Go To Table Of Contents
Contents

Previous
Previous
Next
Next
 

Implementing Web Services

Web services enable applications to interact with one another over the Web in a platform-neutral, language independent environment. In a typical Web services scenario, a business application sends a request to a service at a given URL by using the protocol over HTTP. The service receives the request, processes it, and returns a response. You can incorporate calls with external Web services in application developed in Oracle HTML DB

Web services in Oracle HTML DB are based on Simple Object Access Protocol (SOAP). SOAP is a World Wide Web Consortium (W3C) standard protocol for sending and receiving requests and responses across the Internet. SOAP messages can be sent back and forth between a service provider and a service user in SOAP envelopes.

SOAP offers two primary advantages:

Topics:


Note:

The SOAP 1.1 specification is a W3C note. (The W3C XML Protocol Working Group has been formed to create a standard that will supersede SOAP.)

For information about Simple Object Access Protocol (SOAP) 1.1 see:

http://www.w3.org/TR/SOAP/


Understanding Web Service References

To utilize Web services in Oracle HTML DB, you create a Web service reference using a wizard. Each Web service reference is based on a Web Services Description Language (WSDL) document that describes the target Web service. When you create a Web service reference, the wizard analyzes the WSDL and collects all the necessary information to create a valid SOAP message, including:

  • The URL used to post the SOAP request over HTTP

  • A Universal Resource Identifier (URI) identifying the SOAP HTTP request

  • Operations of the Web Service

  • Input parameters for each operation

  • Output parameters for each operation

Accessing the Web Service References Page

You manage Web service references on the Web Service References page.

To access the Web Service References page:

  1. Navigate to the Workspace home page.

  2. Click the Application Builder icon.

  3. Select an application.

    Application Builder appears.

  4. Click Shared Components.

    The Shared Components page appears.

  5. Under Logic, select Web Service References.

    The Web Service References page appears.

Specifying an Application Proxy Server Address

If your environment requires a proxy server to access the Internet, you must specify a proxy server address on the Application Attributes page before you can create a Web service reference.

To specify a proxy address for an application:

  1. Navigate to the Workspace home page.

  2. Click the Application Builder icon.

  3. Select an application.

    Application Builder appears.

  4. Click Edit Attributes.

  5. Click Edit Standard Attributes.

  6. Under Application Definition, enter the proxy server in Proxy Server.

  7. Click Apply Changes.

Creating a Web Service Reference

When you create a Web service reference you need to decide how to locate the WSDL. You can locate a WSDL in two ways:

  • By searching a UDDI registry

  • by entering the URL to the WSDL document

A Universal Description, Discovery and Integration (UDDI) registry is a directory where businesses register their Web services.

Creating a Web Service Reference by Searching a UDDI Registry

To create a new Web service by searching a UDDI registry:

  1. Navigate to the Web Service References page:

    1. Click the Application Builder icon on the Workspace home page.

    2. Select an application.

    3. Click Shared Components.

    4. Under Logic, select Web Service References.

      The Web Service References page appears.

  2. Click Create.

  3. When prompted whether to search a UDDI registry to find a WSDL, click Yes.

  4. For UDDI Location you can either:

    • Enter a URL endpoint to a UDDI registry.

    • Click the List icon and select a UDDI registry.

  5. Under Search for Services, specify whether to search for a business name or a service name.

    1. For Search Type, specify whether to search for a business name or a service name. You cannot search for both.

    2. In Name, enter the business name or service name to search for.

    3. Optionally indicate whether the search should be case-sensitive or an exact match. Use the percent (%) symbol as a wildcard character.

    4. Click Search.

    5. When the search results appears, make a selection and click Next.

    A summary page appears describing the selected Web service.

  6. Review your selection and click Next to continue.

    The URL to the WSDL document displays in the WSDL Location field.

  7. Click Finish.

The Web service reference is added to the Web Service References Repository.

Creating a Web Service Reference by Specifying a WSDL Document

To create a new Web service by specifying a URL to a specific WSDL document:

  1. Navigate to the Web Service References page:

    1. Click the Application Builder icon on the Workspace home page.

    2. Select an application.

    3. Click Shared Components.

    4. Under Logic, select Web Service References.

      The Web Service References page appears.

  2. Click Create.

  3. When prompted whether to search a UDDI registry to find a WSDL, click No.

  4. In WSDL Location, enter the URL to the WSDL document.

  5. Click Finish.

The Web service reference is added to the Web Service References Repository.

Using the Web Service Reference Repository

Web service references are stored in the Web Service Reference Repository.

To access the Web Service References Repository:

  1. Navigate to the Workspace home page.

  2. Click the Application Builder icon.

  3. Select an application.

    Application Builder appears.

  4. Click Shared Components.

    The Shared Components page appears.

  5. Under Logic, select Web Service References.

    The Web Service Reference page appears.

You can change the appearance of the page by making a selection from the View list. Available options include:

  • Icons (the default) displays each Web service reference as a large icon. To edit a Web service reference, click the appropriate icon.

  • Details displays each application item as a line in a report.

    In Details view you can:

    • Edit a reference by clicking the Edit icon.

    • Test a reference by clicking the Run icon.

    • View details about a reference, by clicking the reference name.

Testing a Web Service Reference

Once you have created a Web service reference you can test it on the Test Web Service Reference.

To test a Web service reference:

  1. Navigate to the Web Service References page:

    1. Click the Application Builder icon on the Workspace home page.

    2. Select an application.

    3. Click Shared Components.

    4. Under Logic, select Web Service References.

      The Web Service References page appears.

  2. From View, select Details.

  3. Click the Run icon adjacent to the Web Service reference name.

    The Test Web Service Reference page appears. The Web service name and URL endpoint display at the top of the page.

  4. From Operation, select an operation (that is, the method to be executed).

  5. Under Input Parameters, enter the appropriate value.

  6. Click Test.

    The message request and response appear at the bottom of the page.

Creating an Input Form and Report on a Web Service

The Create Form and Report on Web Service Wizard creates an input form, a submit button, and a report for displaying results. You can execute this wizard directly after creating the Web service reference, or by adding a new page.

Use this wizard when you expect a nonscalar result from the Web service. The Amazon Web service is a good example. This Web service returns many results based on the search criteria entered in an input form.

Creating a Form and Report Directly After Creating a Reference

To create a form and report directly after creating a Web Service Reference:

  1. Create the Web service reference. See "Creating a Web Service Reference".

  2. Once the Web service references has been added, select Create Form and Report on Web Service.

  3. For Web Service Reference and Operation, select the Web service reference and operation (that is, the method to be executed).

  4. For Identify Page and Region Attributes, review the page and region attributes. If the page you specify does not exist, the wizard creates the page for you.

  5. For Items for Input Parameters:

    1. Identify which items to add to the form. To include an item, select Yes in the Create column. Otherwise, select No.

    2. If necessary, edit the item label.

  6. For Base Node:

    1. In Temporary Result Set Name, enter a name for the collection that stores the Web service result.

    2. For Result Tree to Report On, select the portion of the resulting XML document that contains the information you want to include in the report.

  7. For Result Parameters to Display, select the parameters to be included in the report.

  8. Click Finish.

Creating a Form and Report by Adding a New Page

If you have an existing Web service reference, you can create an input form and report by adding a new page.

To create a form and report by adding a new page:

  1. Create the Web service reference. See "Creating a Web Service Reference".

  2. Create a new page. See "Adding Pages to an Application".

    In the Create Page Wizard:

    1. Select Form.

    2. Select Form and Report on Web Service.

  3. For Web Service Reference and Operation, select the Web service reference and operation (that is, the method to be executed).

  4. For Identify Page and Region Attributes, review the page and region attributes. If the page you specify does not exist, the wizard creates the page for you.

  5. For Items for Input Parameters:

    1. Identify which items to add to the form. To include an item, select Yes in the Create column. Otherwise, select No.

    2. If necessary, edit the item label.

  6. For Base Node:

    1. In Temporary Result Set Name, enter a name for the collection that stores the Web service result.

    2. In Result Tree to Report On, select the portion of the resulting XML document that contains the information you want to include in the report.

  7. For Result Parameters to Display, select the parameters to be included in the report.

  8. Click Finish.

Creating a Form on a Web Service

The Create Form on Web Service wizard creates a form and a submit button. You can execute this wizard directly after creating the Web service reference, or from the Page Definition.

Use this wizard when you expect a scalar result from the Web service. A Web service that looks up a stock price is a good example since the input is a stock symbol and the output is the scalar value price.

Creating a Form Directly After Creating a Reference

To create a form directly after creating a Web Service Reference:

  1. Create the Web service reference. See "Creating a Web Service Reference".

  2. Once the Web service references has been added, select Create Form on Web Service.

  3. For Web Service Reference and Operation, select the Web service reference and operation (that is, the method to be executed).

  4. For Identify Page and Region Attributes, review the page and region attributes. If the page you specify does not exist, the wizard creates the page for you.

  5. For Items for Input Parameters:

    1. Identify which items to add. To include an item, select Yes in the Create column. Otherwise, select No.

    2. If necessary, edit the item label.

  6. For Items for Output Parameters:

    1. Identify which items need to be added. To include an item, select Yes in the Create column. Otherwise, select No.

    2. If necessary, edit the item label.

  7. Click Finish.

Creating a Form by Adding a New Page

If you have an existing Web service reference, you can create form by adding a new page.

To create a form by adding a new page:

  1. Create the Web service reference. See "Creating a Web Service Reference".

  2. Create a new page. See "Adding Pages to an Application".

    In the Create Page Wizard:

    1. Select Form.

    2. Select Form on Web Service.

  3. For Web Service Reference and Operation, select the Web service reference and operation (that is, the method to be executed).

  4. For Identify Page and Region Attributes, review the page and region attributes. If the page you specify does not exist, the wizard creates the page for you.

  5. For Items for Input Parameters:

    1. Identify which items need to be added. To include an item, select Yes in the Create column. Otherwise, select No.

    2. If necessary, edit the item label.

  6. For Items for Output Parameters:

    1. Identify which items need to be added. To include an item, select Yes in the Create column. Otherwise, select No.

    2. If necessary, edit the item label.

  7. Click Finish.

Invoking a Web Service as a Process

You can also implement a Web service as a process on the page. Running the process submits the request to the service provider. You can then display the request results in report.

To invoke a Web service as a process:

  1. Create a new page. See "Adding Pages to an Application".

    In the Create Page Wizard:

    1. Select Blank Page.

    2. When prompted whether to use tabs, select No.

  2. Navigate to the Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  3. Under Page Rendering, Processes, click the Create icon.

    The Create Page Processes Wizard appears.

  4. From the process category, select Web Services.

  5. Specify a process name, sequence, and processing point.

  6. Select the Web service reference and operation (that is, the method to be executed).

  7. Define the process. You can store the results in a collection or in items on the page by selecting options under Web Service Output Parameters.

    1. To store the results in a collection:

      • For Store Result in, select Collection.

      • Enter a name for the collection in the value field.

    2. To store the results in items on the page:

      • For Store Result in, select Items.

      • Enter the appropriate items value in the fields provided.

  8. Click Create Process.

Displaying Web Service Results in a Report

To create a report in which to display Web Service request results:

  1. Navigate to the Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Regions, click the Create icon.

    The Create Region Wizard appears.

  3. For the region type, select Report.

  4. For the report implementation, select Report on collection containing Web service result.On Identify Region Attributes, enter a region title and optionally edit the region attributes.

  5. For Web Service Reference and Operation, select a Web service reference and an operation (that is, the method to be executed).

  6. For Result Tree to Report On, select the portion of the resulting XML document that contains the information you want to include in the report.

  7. For Result Parameters:

    1. In Temporary Result Set Name, enter a name for the collection that stores the Web service result.

    2. Select and deselect the appropriate parameters.

  8. Click Create SQL Report.

Editing a Web Service Process

Once you create a process of type Web service, you can map input parameters to a static value (for example to pass a key) by editing the Web service process.

To edit a Web service process:

  1. Create a Web service process. See "Invoking a Web Service as a Process".

  2. Navigate to the Page Definition containing the Web service process.

  3. Select the process name.

    The Edit Page Process page appears.

  4. Scroll down to Web Service Input Parameters.

  5. To map an input parameter to a static value:

    1. Scroll down to Web Service Input Parameters.

    2. Enter a value in the Value field adjacent to the appropriate parameter name.

  6. Click Apply Changes.

Viewing a Web Service Reference History

The Web Services History displays changes to Web service references for the current application by application ID, Web service references name, developer, and date.

To view a history of Web service reference changes:

  1. Navigate to the Workspace home page.

  2. Click the Application Builder icon.

  3. Select an application.

    Application Builder appears.

  4. Click Shared Components.

    The Shared Components page appears.

  5. Under Logic, select Web Service References.

  6. Click History.


Note:

The History button only appears on the Web Service Reference page after you have created a Web service reference.