A.1 About the SOA Order Booking Application

Oracle provided the SOA Order Booking application with Oracle Application Server 10g Release 3 (10.1.3.1.0) as a sample application that demonstrates many of the key features and components of the Oracle Application Server 10g Release 3 (10.1.3.1.0) release.

The SOA Order Booking application is described in detail in the Oracle SOA Tutorial and in the Oracle SOA Suite Quick Start Guide, which are both available in the Oracle Application Server 10g Release 3 (10.1.3.1.0) Documentation Library on the Oracle Technology Network:

http://www.oracle.com/technology/documentation/index.html

The Oracle Application Server 10g Release 3 (10.1.3.4) patch set introduced a set of improvements and fixes to common problems. In addition, Oracle released a new version of the SOA Order Booking that was tested and improved for 10g Release 3 (10.1.3.4).

This appendix assumes you are familiar with the SOA Order Booking application and the technologies it demonstrates.

Before you migrate the SOA Order Booking application to 11g, test the application on 10g Release 3 (10.1.3.4) and make sure that it is functioning properly. This ensures that the database where the SOA Order Booking schemas are installed is up and running and the external services and external partners are up and running.

For example, you should be able to log in to the application, browse the list of products (Figure A-2), and place an order. You should also be able to monitor the BPEL processes using the BPEL Worklist Manager.

A.2.3 Task 1c: Verify That All External Partners Are Available

Before you can upgrade the SOA Order Booking application to 11g, you must ensure that the external partners (in the form remote Web services) are up and running and available.

Oracle JDeveloper 11g must be able to access these external partners, as well as the Oracle BPEL Process Manager and Oracle Enterprise Service Bus services deployed on 10g; otherwise, it can not properly migrate the projects in your application to 11g.

To verify that the required Web services are available, you should review each of the projects in your Oracle SOA Suite applications before you migrate them to 11g. For example, you can review the Oracle BPEL Process Manager configuration files for each project and verify that the Web services URIs referenced in those configuration files are valid and working.

For example, in the SOA Order Booking application, you can review the contents of the SOAOrderBooking project, as follows:

After you verify that the SOA Order Booking application is running successfully on your Oracle Application Server 10g Release 3 (10.1.3) environment, you can then install a new Oracle Fusion Middleware 11g environment and upgrade the environment.

A.4.1 Task 3a: Create the SOADEMO Data Source

Before you can deploy the SOA Order Booking sample application on Oracle WebLogic Server, you must first define an Oracle WebLogic Server data source that references the database where the SOA Order Booking schemas are installed.

Select Redeploy this application and confirm the deployment plan location, and click Finish.

A.5 Task 4: Install Oracle JDeveloper 11g

You can install Oracle JDeveloper 11g from the ZIP file on the Oracle Fusion Middleware Companion CD or by downloading the Oracle JDeveloper Studio Edition Version 11.1.1.1.0.0 ZIP file from the Oracle Technology Network (OTN):

http://www.oracle.com/technology/software/products/jdev/index.html

You can install JDeveloper on the same machine that is running Oracle Fusion Middleware 11g, or you can install it on a different machine from the one where Oracle Fusion Middleware is running.

A.6 Task 5: Set Up Connections in Oracle JDeveloper Release 11

In Oracle JDeveloper Release 11 (11.1.1.0.0), you set up connections to the database, to Oracle Application Server. These connections enable you to view the data in the SOADEMO schema, and to deploy the applications to Oracle Fusion Middleware from JDeveloper.

A.6.2 Task 5b: Verify That You Have the Required Oracle JDeveloper Extensions

To upgrade your Oracle SOA Suite applications to 11g, you must have the Oracle SOA Composite Editor extension for Oracle JDeveloper 11g.

To verify that the extension is installed, select About from the Oracle JDeveloper Help menu, and click the Version tab. You should see an entry in the list of components called SOA Composite Editor.

If this component does not appear on the Version tab of the About dialog box, close the About dialog and select Check for Updates from the Help menu. Use the Check for Updates wizard to locate and install the latest version of the SOA Composite Editor extension.

A.6.3 Task 5c: Create a Connection to the SOADEMO Schema

In JDeveloper, create a database connection to the SOADEMO schema:

Note:

In this tutorial, the database connection is named SOADEMO. You can use a different name if you want, but using the same naming conventions will make it easier to follow the instructions.

In Oracle JDeveloper, select View > Database Navigator.

Right-click the IDE Connections node and select New Connection.

In the resulting dialog box, enter the following values:

Connection Name: enter SOADEMO.

Connection Type: select Oracle (JDBC).

Username: enter SOADEMO.

Password: enter soademo.

Role: leave blank.

Save Password: select the check box.

Enter Custom JDBC URL: clear the check box.

Driver: select thin.

Host Name: enter the name of the machine running the database where you installed the SOADEMO schema.

JDBC Port: enter the port number for the database. The default value is 1521.

SID: enter the system identifier for the database. The default value is ORCL.

If you are unsure about the database connection values, check with your database administrator.

Click Test Connection.

If the test is not successful, check that the database is available and that the connection values are correct.

Click Finish. The connection appears below the Database node in the Connection Navigator.

You can now examine the schema from Oracle JDeveloper. In the Connection Navigator, expand Database > SOADEMO. Expand the Sequences and Tables nodes and verify that the tables match those listed in Section 1.4, "Contents of the SOADEMO Schema" of the 10g Release 3 (10.1.3.1.0) Oracle SOA Tutorial.

The connection appears below the Application Servers node in the Connection Navigator.

A.7 Task 6: Open the SOA Order Booking Application in Oracle JDeveloper 11g and Migrate the Application Projects

The following sections describe how you can open an application created in a previous version of Oracle JDeveloper and use the Migration Wizard to upgrade the application to Oracle Fusion Middleware 11g:

The SOA Order Booking application and its projects rely upon external partners. These remote Web services must be up and running and available to the SOA Order Booking application before you migrate the application to Oracle Fusion Middleware 11g.

Clearing the Migrate to WebApp 2.5 check box is important because the SOA Order Booking demo application uses Web services that you will upgrade manually later in this procedure. To be sure the Migration wizard does not attempt to upgrade these automatically, be sure to clear the Migrate to WebApp 2.5 check box.

In Step 4, review the items on the page, accept the default selections, and click Next .

In Step 5, review the setup options you selected, and click Finish to upgrade the application to Oracle JDeveloper 11g.

JDeveloper displays a Migration Status dialog box that indicates the progress of the migration. In addition, information about the migration is displayed in the logging pane in the main Oracle JDeveloper window.

When the migration is complete, click Finish.

A.7.2 Viewing the Migration Log Files

After the migration, you can review the log files generated during the application migration. The log files describe the various changes that Oracle JDeveloper 11g makes to the projects as they are opened and migrated to Oracle JDeveloper 11g.

The log files are located in the following directory:

JDEV_HOME\upgrade\logs\

You an identify the different log files for each application by viewing the date and time stamp in each log file name. For example:

SOAOrderBooking2009-04-29-12-46-35PM.log

In addition, the Messages tab in the Oracle JDeveloper main window displays links to the individual log files for each project that was migrated. Click any of the links to display a migration log file.

A.8 Task 7: Compile and Deploy Each of the Application Projects on Oracle Fusion Middleware 11g

After you have opened the SOADEMO application and migrated the projects to Oracle JDeveloper 11g, you can now recompile each of the projects and redeploy them one by one.

A.8.1 About the CreditService, RapidService, and CustomerService Projects

The CreditService, RapidService, and CustomerService projects in the SOA Order Booking application are Java EE Web services that are referenced by the other projects in the application.

As a result, for the purposes of this example, it is not necessary to upgrade these three projects to 11g. Instead, you can continue to use the Oracle Application Server 10g versions of these services, which are currently running in your 10g environment.

If you choose to upgrade these three Web services projects, note the following:

The instructions for modifying the Web services projects in this Appendix should be adequate if you are familiar and experienced with developing Java EE applications and Web services; however, they are not designed to serve as a tutorial for upgrading Java EE projects.

If you choose to upgrade the CustomerService Web services project, some additional changes will be required to the SOAOrderBooking project, which are not documented in detail in this Appendix.

A.8.2 SelectManufacturer

The SelectManufacturer project is an asynchronous BPEL process. This means that it contains a receive activity to initiate the BPEL process flow and an invoke activity to call back the client asynchronously with the results (that is, the quote) at the end of the flow.

To compile and redeploy the SelectManufacturer project:

Right-click the project in the Application Navigator.

From the context-menu, select Make SelectManufacturer.jpr.

The project should compile successfully.

Right-click the project again and select Deploy > SelectManufacturer.

Oracle JDeveloper displays the first page of the Deployment wizard.

Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.

A.8.3 DHLShipment

The DHLShipment project was created as an Oracle Enterprise Service Bus (ESB) service in Oracle Application Server 10g Release 3 (10.1.3). It should require no changes after opening the project in Oracle JDeveloper 11g.

To compile and redeploy the DHLShipment project:

Right-click the project in the Application Navigator.

From the context-menu, select Make DHLShipment.jpr.

Right-click the project again and select Deploy > DHLShipment.

Oracle JDeveloper displays the first page of the Deployment wizard.

Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.

A.8.4 FulfillmentESB

The FulfillmentESB project was created in 10g Release 3 (10.1.3) as an Oracle Enterprise Service Bus (ESB) project.

After an order has been approved, the SOAOrderBooking project invokes the FulfillmentESB project to determine the shipping method for the order.

Orders are sent to the USPS through a file adapter. The order information is written to a file. For Fedex, orders are sent through a database adapter. The order information is written to a database. The FulfillmentESB project also sends orders to a JMS queue.

Before you can compile and deploy this project, you need to make some minor changes in Oracle JDeveloper 11g:

Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.

A.8.5 CreditService

The CreditService project checks whether a customer's credit card is valid or not. In this SOA Order Booking application, the code simply checks the value of the credit card number. If the credit card number is less than 12345678, then the card is invalid. Otherwise, it is valid.

Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.

A.8.6 RapidService

The RapidService project represents a supplier that provides price quotes for customer orders. The other supplier which it competes with is SelectManufacturer. The supplier that provides the lower quote for a customer's order gets to fulfill the order.

Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.

A.8.7 CustomerService

The CustomerService project is an EJB implementation that provides methods that enable client applications, such as the SOADemo-Client application, to retrieve customer information from the database and add customers to the database.

A.8.7.2 Modifying the persistence.xml File in the CustomerService Project

Modify the src/META-INF/persistence.xml so it uses Kodo explicitly in Oracle Weblogic Server.

Kodo an implementation of Sun Microsystem's Java Persistence API (JPA) specification and Java Data Objects (JDO) specification for transparent data objects. Kodo is available as a stand-alone product and is integrated within WebLogic Server.

Add the following entry inside the <persistence-unit> element in the persistence.xml file:

<provider>kodo.persistence.PersistenceProviderImpl</provider>

A.8.7.3 Compiling and Deploying the CustomerService Project

To compile and redeploy the Fulfillment project:

Right-click the project in the Application Navigator.

From the context-menu, select Make CustomerService.jpr.

Right-click the project again and select Deploy > CustomerService.

Oracle JDeveloper displays the first page of the Deployment wizard.

Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.

A.8.8 SOAOrderBooking

The SOAOrderBooking project, which is a BPEL project, represents the main flow in the SOA Order Booking application. It sends the order information to the appropriate services at the appropriate times. For example, it contacts CreditService to check the customer's credit card, and if the credit card is acceptable, it contacts the suppliers (Select Manufacturer and Rapid Distributors) to get price quotes for the order.

Before you can compile and deploy this project from Oracle JDeveloper 11g, you must make some changes:

If you upgraded and redeployed the RapidService, CreditService, and CustomerService projects earlier in this procedure, you can now modify the SOAOrderBooking project to use the new 11g Web services, rather than the ones that are deployed and still running in your Oracle Application Server 10g environment.

In the Target Navigation Pane, expand the SOA folder, and then expand the soa-infra (soa_server1) node to display the SOA composite applications deployed to the domain.

Click the OrderBookingESB composite application.

Fusion Middleware Control displays the Dashboard tab of the OrderBookingESB composite application home page, which you can use to manage and monitor a deployed SOA composite application.

Click Test in the button bar across the top of the page.

Fusion Middleware Control displays the Test Web Services page, which displays the WSDL location, Operations list, and two tabs, Request and Response tabs.

Scroll down to the Input Arguments section of the page.

From this section of the page, you can enter input data to test the composite application. The SOA Order Booking application ZIP file contains two text files that contain sample data you use to test the SOA Order Booking application.

Locate the following input sample test file in the root directory of the SOADEMO_HOME:

sampleInput2.txt

Open sampleInput2.txt and select and copy the entire contents of the file.

Select XML View from the drop-down menu in the Input Arguments section of the Test Web Service page.

Select and delete the XML content displayed on the Request tab in the Input Arguments section of the page.

Figure A-11 shows the XML content selected in the Input Arguments section of the page.

Paste the contents of the sampleinput2.txt file into the text field, and click Test Web Service at the bottom of the page.

After a few seconds, a message appears indicating that the Web service invocation was successful. It also displays the return value obtained by the service.

Click the Launch Message Flow Trace link to see the flow of your composite and the status of each service, component, and reference.

Fusion Middleware Control displays the Flow Trace page (Figure A-12), which shows each step in the process flow. Using this view, you can monitor the application as it progresses through each component and task in the application.

You can also a click a component to drill down into the Instance Details for the component.

For further testing, you can perform this same procedure using sampleinput1.txt, which is in the same directory as sampleinput2.txt and submits an order of more than $1000.

For sampleinput1.txt, you'll notice that the work flow stops and does not continue, until you log into the following URL and approve the order: