Previous
Previous
 
Next
Next

Example: Creating a Web Service Reference from a WSDL

To utilize Web services in Oracle Application Express, you create a Web service reference using a wizard. When you create the Web reference, you can follow one of these methods:

In this example, you create a Web service reference by supplying the location of a WSDL document to a Web service. You then test the Web service reference and create a form and report to display movie theaters and locations.


Note:

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. See Specifying an Application Proxy Server Address for instructions.


Note:

The following example is dependent upon the availability of the specified Web service ultimately invoked. If the Web service is unavailable, you may experience difficulties completing this exercise.

Create a Web Service Reference from a WSDL

To create a new Web reference by supplying the WSDL location:

  1. On the Application home page, click Shared Components.

    The Shared Components page appears.

  2. Under Logic, select Web Service References.

  3. Click Create.

  4. Choose Based on WSDL and click Next.

  5. When prompted whether to search a UDDI registry to find a WSDL, select No and click Next.

  6. In the WSDL Location field enter the following and click Next:

    http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx?wsdl

    A summary page appears describing the selected Web service.

  7. Click Create Reference.

    The Create Web Service Reference page appears. The Web service reference for MovieInformation is added to the Web Service References Repository.

Create a Form and Report of the Web Service Result

Next, you need to create a page that contains a form and report to use with your Web Service Reference.

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

  1. On the Create Web Service Reference success page, select Create Form and Report on Web Service.

  2. For Choose Service and Operation:

    1. Web Service Reference - Select MovieInformation.

    2. Operation - Select GetTheatersAndMovies.

    3. Click Next.

  3. For Page and Region Attributes:

    1. Form Region Title - Change to Theater Information.

    2. Accept the other defaults and click Next.

  4. For Input Items:

    1. For P2_ZIPCODE and P2_RADIUS, accept the default, Yes, in the Create column.

    2. For P2_ZIPCODE, change the Item Label default to ZIP Code.

    3. Click Next.

  5. For Web Service Results:

    1. Temporary Result Set Name (Collection) - Accept the default.

    2. Result Tree to Report On - Select Theater (tns:Theater).

    3. Click Next.

  6. For Result Parameters, select all the parameters and click Finish.

  7. Click Run Page.

  8. If prompted to log in, enter the user name and password for your workspace and click Login.

    A form and report resembling Figure: Theater Information Form and Report without Data appear. Notice that the Theater Information Form at the top of the page contains a data entry field and a submit button, but the Results Report does not contain any data.

    Theater Information Form and Report without Data

    Description of this figure follows
    Description of "Theater Information Form and Report without Data"

  9. To test the form, enter 43221 in the ZIP Code field and 5 in the Radius field. Then click Submit.

    The report at the bottom of the page should resemble Figure: Theater Information Report Showing Resulting Data. The report lists the names and addresses of movie theaters matching the entered ZIP code and radius.

    Theater Information Report Showing Resulting Data

    Description of this figure follows
    Description of "Theater Information Report Showing Resulting Data"