ADF Web Service Sample

Overview

This sample application serves as an example of how to build an ADF JSP application which demonstrates interaction with both local database data and external data from a Web service using ADF as a framework.

For this sample, a list of airports is queried from a database table and presented to the user as an HTML select control. The user selects an airport and a Web Service is called to get the weather conditions for the selected airport.

The ADF framework is used both to display the airport data and retreive the Web service data.

Requirements

You must have JDeveloper 10g and access to an Oracle database with the Oracle common schema installed on it. If you do not have the common schemas installed, follow these instructions. This sample depends on the hr_conn connection as defined in those instructions.

You'll need to add the table defined in the SQL script (airport.sql) to the common schema.  To do this in JDeveloper, if you have SQL*Plus installed,

  1. Open the View project in the Application Navigator.
  2. Open the Resources folder/
  3. Right click on airport.sql.
  4. Select Run in SQL*Plus|hr_conn
    If you haven't used SQL*Plus with JDeveloper, you may be prompted for the location to SQL*Plus. Enter it and click OK.

If you don't have SQL*Plus installed, you could also use the SQL Worksheet available in JDeveloper.

  1. From the Tools menu, select SQL Worksheet.
  2. Copy all contents of the script into the SQL Worksheet.
  3. Click the Execute Statement button.

This script is designed for the Oracle database. It may not work on other databases.

To drop the airports table you can use the drop_airport.sql script.

Running the sample

To run the sample right-click on the View project and select run from the context menu.

TroubleShooting

If your application fails to run because of a JBO error, it is most probably because you do not have a connection defined as hr_conn. The Model project assumes you have a connection hr_conn which it assumes is where your airport table was created. To make sure your Model project can access your database, you can test the business logic in your Model project by right-clicking Test on the AppModule node in the Model project. From the Test utility you can then specify the correct connection to your schema.

Building this Application

Detailed instructions on how to build this application from scratch ar provided in the building_the_airport_app.html document.