Oracle® Fusion Middleware Upgrade Guide for Oracle SOA Suite, WebCenter, and ADF 11g Release 1 (11.1.1) E10127-02 |
|
![]() Previous |
![]() Next |
This appendix provides the step-by-step procedure for upgrading a complex Oracle SOA Suite (SOA) application from Oracle Application Server 10g Release 3 (10.1.3.3) to Oracle Fusion Middleware Release 11 (11.1.1.0.0).
This procedure is meant to serve as an overall example of the Oracle SOA Suite environment and application upgrade process.
Specifically, this appendix contains the following topics:
Task 1: Verify That the SOA Order Booking and Its External Partners are Up and Running
Task 2: Install and Upgrade the Oracle Fusion Middleware SOA Suite
Task 3: Use the Oracle WebLogic Suite Administration Console to Configure Required Resources
Task 7: Compile and Deploy Each of the Application Projects on Oracle Fusion Middleware 11g
Task 8: Test the SOA Order Booking Application in Fusion Middleware Control
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.
Figure A-1 shows the login page of the SOA Order Booking Demo, deployed on Oracle Application Server 10g Release 3 (10.1.3.4).
Figure A-1 SOA Order Booking Application Deployed on 10g Release 3 (10.1.3.4)
Before you can migrate the SOA Order Booking application to 11g, you must review the following prerequisites:
Before you can migrate the SOA Order Booking application to 11g, it is assumed that:
You have already installed and configured Oracle Application Server 10g Release 3 (10.1.3.1.0), and you have applied the 10g Release 3 (10.1.3.4) patch set.
You have already installed and configured Oracle JDeveloper 10g Release 3 (10.1.3.4).
You have downloaded the updated 10g Release 3 (10.1.3.4) version of the SOA Order Booking demo application.
You can download the 10g Release 3 (10.1.3.4) SOA Order Booking demo application from the following location on the Oracle Technology Network (OTN):
http://www.oracle.com/technology/products/ias/bpel/
You have used the instructions in the 10g Release 3 (10.1.3.1.0) Oracle SOA Suite Tutorial or Oracle SOA Suite Quick Start Guide to deploy the SOA Order Booking application on Oracle Application Server 10g Release 3 (10.1.3.4).
This includes installing the database schemas for the SOA Order Booking 10g Release 3 (10.1.3.4) application in an available database.
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.
Figure A-2 Browsing Items in the SOA Order Booking Application
For more information, see "Running and Monitoring the SOA Order Booking Application" in the Oracle Application Server 10g Release 3 (10.1.3) Oracle SOA Suite Quick Start Guide.
The Oracle SOA Suite Quick Start Guide is included in the Oracle Application Server 10g Release 3 (10.1.3) documentation library, which is available on the Oracle Technology Network (OTN):
http://www.oracle.com/technology/documentation/
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:
Open the SOA Order Booking 10g Release 3 (10.1.3.4) application in Oracle JDeveloper 10g Release 3 (10.1.3).
Expand the SOAOrderBooking project, and then expand the Integration Content folder.
Expand the bpel folder and double-click the bpel.xml
file (Figure A-3).
Figure A-3 Selecting a bpel.xml File to Test WSDL URLs
Inside the bpel.xml file, search for the following entry:
<partnerLinkBinding name="OrderFulfillment"> <property name="wsdlLocation"> http://host.domain:port/esb/wsil/Fulfillment/OrderFulfillment?wsdl </property> <property name="preferredBindings"> http://www.oracle.com/esb/ </property> </partnerLinkBinding>
Copy the URL in the wsdlLocation
element to your browser and verify that the URL is valid and displays the output shown in Figure A-4.
If the Web Services URL do not display correctly, troubleshoot and solve the problem before attempting to migrate the application to 11g.
For example, make sure the database where the SOA Order Booking schemas are installed is up and running and that all components of the application have been deployed successfully.
Repeat this procedure for the other URLs in the bpel.xml
file.
Perform a similar test for the WSDL URLs in the following projects:
SOAOrderBooking:
CreditValidatingService.wsdl CustomerSvc.wsdl RapidService.wsdl
OrderBookingESB:
OrderBooking_OrderBookingProcess.esbsvc OrderBooking_OrderBookingService.esbsvc
Figure A-4 OrderFulfillment WSDL URL in Internet Explorer
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.
Follow the instructions in Chapter 6, "Upgrading an Oracle SOA Suite Environment" to prepare the Oracle Fusion Middleware environment for the SOA Order Booking migration and redeployment.
This task includes:
Installing and configuring the Oracle SOA Suite 11g middle tiers
Upgrading the Oracle SOA Suite schemas to 11g
The SOA Order Booking demo application requires that a data source and a set of JMS resources be available on the Oracle WebLogic Server managed server where SOA Order Booking is deployed.
Refer to the following sections for information on how to use the Oracle WebLogic Server Administration Console to create these resources:
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.
These are the same schemas you installed previously, when you deployed the SOA Order Booking demo application on Oracle Application Server 10g Release 3 (10.1.3.4), as described in Section A.2, "Task 1: Verify That the SOA Order Booking and Its External Partners are Up and Running".
In the Domain Structure tree, expand Services > JDBC, then select Data Sources.
On the Summary of Data Sources page, click New.
Oracle WebLogic Server displays the JDBC Data Source Properties page.
Enter the following properties on this page:
Name: soademoDS
JNDI Name: jdbc/soademoDS
Database Type: Oracle
Database Driver: Oracle's Driver (Thin XA)
Click Next to display the Transaction Options page:
Select Supports Global Transactions.
Select Logging Last Resource.
Click Next to display the Connection Details page ().
Database Name: Oracle_database_system_identifer_(SID)
Host Name: Host_where_the_database_is_installed
Port: Database_listening_port_for_example_1521
Database User Name: soademo
Password and Confirm Password: soademo
Click Next to test the database connection.
Click Next to display the Select Targets page, and select the soa_server1.
Click Finish to deploy the data source on soa_server1.
To connect to the database, the SOA Order Booking application requires some changes to the default DbAdapter application that is installed and configured as part of a Oracle SOA Suite 11g domain.
Refer to the following sections for instructions on how to configure the DbAdapter for the SOA Order Booking application:
Creating a New Outbound Connection Pool for the DbAdapter Application
Configuring the New Connection Pool for the DbAdapter Application
Use the following procedure to create a new outbound connection pool in the DbAdapter application:
Create a directory where the deployment plan for the DbAdapter application can be saved.
For example:
MW_HOME/Oracle_SOA1/soa/DBPlan
In the Domain Structure tree, click Deployments.
Click the DbAdapter application (click the name, not the check box).
Click the Configuration tab, and then click the Outbound Connection Pools tab.
Click New.
Select the radio button for javax.resource.cci.ConnectionFactory
and click Next.
Enter the JNDI Name as follows: eis/DB/soademoDS
Note that this JNDI name must match the value you enter in your database connection, which you create when upgrading your application with Oracle JDeveloper later in this procedure.
Click Finish.
At this point, you should be asked for the deployment plan location.
Click on the path to the directory you created earlier and enter the deployment plan name Plan.xml
.
Verify that the correct deployment plan is selected.
Click Next and then click Finish.
Use the following procedure to configure the new connection pool so it references the data source:
Click the Configuration tab, expand the connection factory, and click your new connection pool (click on the name, not the check box).
In the Properties table, select the box to the right of xADataSource.
The edit box appears.
Enter the name of the data source name that you created previously:
jdbc/soademoDS
Press ENTER to apply the value and click Save.
You must use the ENTER key for the value to be entered in the field, and you must click Save to save your changes.
Return to the Deployments page and click Deployments in the left navigation bar.
Select the check box next to DbAdapter.
Click Update.
Select Redeploy this application and confirm the deployment plan location, and click Finish.
Verify your changes to ensure that the configuration is correct; otherwise, deployment errors will occur later:
Confirm that the connection pool is added, by returning to the DbAdapter > Configuration > Outbound Connection Pools page and expanding the connection factory.
Confirm the value of the xADataSource property that you entered previously.
Return to the DbAdapter Outbound Connection Pools tab, and review the connection factory property value for the eis/DB/soademoDS
connection pool.
The SOA Order Booking sample application uses message queues to transmit order and fulfillment details. As a result, you must configure a JMS queue before you can deploy the application successfully.
You can use WLST commands and scripts to configure JMS, but these instructions show how to use the Oracle WebLogic Administration Console to configure JMS.
The following sections describe how to configure JMS for the SOA Order Booking Demo sample application:
Creating a JMS Connection Factory for the SOA Order Booking Demo
Creating an Outbound Connection Pool for the JmsAdapter Application
To create the JMS destinations required for the SOA Order Booking Demo:
In the Oracle WebLogic Administration Console, navigate to the Summary of JMS Modules page and click the SOAJMSModule JMS module.
This module is created and configured during the Oracle SOA Suite 11g installation and configuration.
On the JMS Module Configuration page, click New.
From the list of resource types, select Queue.
On the JMS Destination Properties page, enter a name and JNDI location for the the destination queue.
For the purposes of this procedure, enter the following values:
Name: demoFulfillmentQueue
JNDI Name: jms/demoFulfillmentQueue
Click Next.
Select SOASubDeployment from the SubDeployments drop-down menu.
Select the SOAJMSServer JMS Server and click Finish.
To create the connection factories required by the SOA Order Booking Demo sample application:
In the Oracle WebLogic Administration Console, navigate to the Summary of JMS Modules page and click the SOAJMSModule JMS module.
On the JMS Module Configuration page, click New.
From the list of resource types, select Connection Factory and click Next.
On the Connection Factory Properties page, enter a name and a JNDI location for the JMS connection factory.
Use the following values:
Name: demoCF
JNDI Name: jms/demoCF
Click Next.
Click Finish.
You should see both the queue and the connection factory listed in the Summary of Resources.
Use the following procedure to create a new connection pool. The connection pool is configured in the JmsAdapter application and uses a Deployment Plan:
Create a directory for the JmsAdapter application deployment plan.
For example:
MW_HOME/Oracle_SOA1/soa/JMSPlan
In the Oracle WebLogic Server Administration Console, click Deployments.
Click JmsAdapter (click the name, not the check box).
Click the Configuration tab and then the Outbound Connection Pools tab
Click New.
Select the factory oracle.tip.adapter.jms.IJmsConnectionFactory
.
Click Next.
Enter eis/demo/Queue
.
Click Finish.
At this point, you should be asked for the deployment plan location.
Click the path to the directory you created earlier and enter Plan.xml
for the plan name.
If there is a plan file selected with the radio button at the bottom of the screen, the one you enter will take precedence.
Click Next and then click Finish.
Use the following procedure to configure the connection pool you created in the previous section:
In the Oracle WebLogic Server Administration Console, click Deployments.
Click JmsAdapter (click the name, not the check box).
Click the Configuration tab and then the Outbound Connection Pools tab
Expand the oracle.tip.adapter.jms.IJmsConnectionFactory
connection factory.
Click eis/demo/Queue
.
Change the value of the ConnectionFactoryLocation property to jms/demoCF
and press ENTER.
You must use the ENTER key for the value to be entered in the field.
Click Save.
You must use the Save button to save the value.
Use the following procedure to redeploy the JmsAdapter application:
Click Deployments in the Oracle WebLogic Server Administration Console navigation tree.
Select the check box next to JmsAdapter.
Click Update at the top of the Deployment table.
Verify that the correct deployment plan is selected.
Select Redeploy this application and confirm the deployment plan location, and click Finish.
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.
For complete information, see Oracle Fusion Middleware Installation Guide for Oracle JDeveloper.
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.
This task includes the following subtasks:
To start Oracle JDeveloper Studio on Windows, use any of the following methods:
From your Start Menu, select All Programs, then select Oracle Fusion Middleware 11.1.1.x.x, and then select Oracle JDeveloper Studio 11.1.1.x.x.
You can also start Oracle JDeveloper from the command line by running one of the following commands:
install_dir\jdeveloper\jdeveloper.exe install_dir\jdeveloper\jdev\bin\jdevw.exe install_dir\jdeveloper\jdev\bin\jdev.exe (to display a console window for internal diagnostic information)
To start Oracle JDeveloper on UNIX systems, run the file:
install_dir/jdeveloper/jdev/bin/jdev
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.
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 > 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.
In JDeveloper, create a connection to the Oracle WebLogic Server domain where you installed and configured Oracle SOA Suite 11g:
In Oracle JDeveloper, select View > Application Server Navigator.
Right-click the Application Servers folder under the Application Server node and select New Application Server.
Click Next on the Welcome page of the Application Server Connection Wizard.
Enter the following values:
Connection Name: enter SoademoApplicationServer
.
Connection Type: select WebLogic 10.3.
Click Next.
In Step 2, Authentication, enter the following values:
Username: Enter weblogic. This is the name of the default Oracle WebLogic Server administration user.
Password: Enter the password for the weblogic
user. This is the password that you set when you configured the Oracle SOA Suite 11g domain.
Click Next and enter the host, port, and name of the Oracle WebLogic Server domain you installed and configured in Section A.3, "Task 2: Install and Upgrade the Oracle Fusion Middleware SOA Suite".
Click Next. The Test Connection page appears.
Click Test Connection.
Click Finish.
The connection appears below the Application Servers node in the Connection Navigator.
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:
Important: 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.You cannot successfully open the application in Oracle JDeveloper 11g if the external partner URI's are not available. For more information, see Task 1: Verify That the SOA Order Booking and Its External Partners are Up and Running. |
To open and migrate the application to Oracle JDeveloper 11g:
Make a backup copy of the soademo folder that contains the 10g Release 3 (10.1.3.4) SOA Order Booking Demo application source files.
The contents of the soademo folder will be modified during the upgrade. The backup copy allows you to restore the original 10g Release 3 (10.1.3) version of the demo if necessary.
Note that for this procedure, the working folder (the folder containing the files you will upgrade) is referred to as the SOADEMO_HOME directory.
Review the contents of the SOADEMO_HOME directory and remove the following file if it exists:
SOADEMO_HOME/SOAOrderBooking/bpel/rules/com
This includes the subdirectories under the bpel/rules/com/
directory.
Select Open from the File menu and select the Oracle JDeveloper 10g Release 3 (10.1.3.1.0) soademo.jws
file.
Oracle JDeveloper displays Step 1, the Welcome page, of the Migration Wizard.
Click Next.
In Step 2 (Figure A-5), select Yes to migrate the project files to Oracle JDeveloper Release 11 (11.1.1.0.0).
Click Next.
Figure A-5 Step 2 of the Oracle JDeveloper 11g Migration Wizard
In Step 3, clear the Migrate to Webapp 2.5 and Convert JSTL 1.0/1.1 to 1.2.
Note: 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. |
Click Next.
Figure A-6 Clearing the WebApp 2.5 Option in the Oracle JDeveloper Migration Wizard
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.
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.
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.
Review, compile, and redeploy each project in the following order:
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.
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.
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 > SelectManafacturer.
Oracle JDeveloper displays the first page of the Deployment wizard.
Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.
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:
Make the following changes to the FulfillmentESB project:
Expand the FullfillmentESB project and double-click composite.xml.
Oracle JDeveloper displays the FulfillmentESB composite in the SOA Composite Editor (Figure A-4).
For more information, see "Introduction to the SOA Composite Editor" in the Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite.
Double-click the icon that represents the Fulfillment.FulfillmentBatch reference in the right swimlane.
This external reference represents the Fulfillment.FulfillmentBatch JMS adapter.
When you double-click this reference, Oracle JDeveloper displays the Adaper Configuration Wizard.
Follow the instructions in the Adapter Configuration Wizard to reconfigure the JMS Adapter for your Oracle Fusion Middleware 11g environment.
You can accept all the default settings in the wizard, except for the following:
Select Oracle Weblogic JMS as the Oracle Enterprise Messaging service.
Select the Application Server connection that you created in "Task 5d: Create a Connection to Oracle WebLogic Server".
Click the Browse button next to the queue name and select demoFulfillmentQueue.
This should cause jms/demoFullfillmentQueue
to be entered into the Queue Name field.
Set the JNDI name to eis/demo/Queue
.
When you return to the Composite Editor, double-click the icon that represents the Fulfillment.FedexShipment reference in the right swimlane.
This external reference represents a database adapter.
When you double-click this reference, Oracle JDeveloper displays the Adaper Configuration Wizard.
Follow the instructions in the Adapter Configuration Wizard to reconfigure the database adapter for your Oracle Fusion Middleware 11g environment.
You can accept all the defaults in the wizard, except for the following changes:
Select soademo
as your database connection.
Set the JNDI name to eis/DB/soademoDS
.
Update the Fulfillment.USPSShipment external reference (which represents a file adapter), as follows:
Create a directory on disk for the file adapter; for example:
MW_HOME/Oracle_SOA1/soa/USPSShipment
Return to the Composite Editor for the FulfillmentESB project, and double-click the FulfillmentUSPSShipment external reference.
Oracle JDeveloper displays the Adapter Configuration Wizard.
Follow the instructions on the screen until the File Configuration screen appears.
In the Directory for Outgoing Files (physical path) field, enter the path to the directory you created in Step 7a.
Click Next and follow the rest of the adapter configuration instructions.
Figure A-7 Composite Editor for the FulfillmentESB Project of the SOA Order Booking Application
To compile and redeploy the Fulfillment project:
Right-click the project in the Application Navigator.
From the context-menu, select Make FulfillmentESB.jpr.
Right-click the project again and select Deploy > FulFillmentESB.
Oracle JDeveloper displays the first page of the Deployment wizard.
Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.
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.
This project is a Java EE Web services project. Before you proceed, refer to Section A.8.1, "About the CreditService, RapidService, and CustomerService Projects".
Before you can compile and deploy this project, you must upgrade the Web service from OC4J JAX-RPC to Oracle WebLogic Server JAX-RPC:
To upgrade the OC4J JAX-RPC Web service to Oracle WebLogic Server JAX-RPC:
In the Application Navigator, expand the CreditService project, and select the following:
Application Sources > org.soademo.creditservice > CreditService
Right-click the Credit Service Web service and select Upgrade Web Service to WLS JAX-RPC Configuration from the context menu.
Oracle JDeveloper displays the Confirm Upgrade dialog box.
Click Yes to upgrade the CreditService Web service to Oracle WebLogic Server JAX-RPC.
When the upgrade is complete, save the project.
Figure A-8 Confirmation Dialog Box When Upgrading the CreditService Web Service
To compile and redeploy the CreditService project:
Right-click the project in the Application Navigator.
From the context-menu, select Make CreditService.jpr.
Right-click the project again and select Deploy > CreditService.
Oracle JDeveloper displays the first page of the Deployment wizard.
Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.
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.
This project is a Java EE Web services project. Before you proceed, refer to Section A.8.1, "About the CreditService, RapidService, and CustomerService Projects".
Before you can compile and deploy this project, you must modify it using Oracle JDeveloper 11g:
Before you can compile and deploy this project, you must upgrade the OC4J JAX-RPC Web services to Oracle WebLogic Server JAX-WS.
The following procedure uses the "top-down" approach to regenerate the Web service using the existing WSDL:
Remove the existing JAX-RPC Web service files from the RapidService project:
In Oracle JDeveloper 11g application navigator pane, open the RapidService project and expand following node:
Application Sources > org.soademo.rapidservice
Right-click the RapidService node and select Delete from the context menu.
In the Delete Web Service? dialog box, click Select All to select all the files shown in the dialog box.
Clear the check box for the RapidService.wsdl
file, as shown in Figure A-9.
Click OK.
Figure A-9 Deleting the RapidService Web Service
Expand the contents of the Types node and delete Item.java
, Quote.java
.
Expand the contents of the Web Content > WEB-INF node, and then delete web.xml
.
Figure A-10 shows the files under RapidService that you must select and then delete.
Figure A-10 Removing the RapidService Web Services Files and Related Files
Remove JAX-RPC Web Services from the classpath:
Right-click the RapidService project and select Project Properties from the context menu.
Oracle JDeveloper displays the Project Properties window.
Select Libraries and Classpath, select JAX-RPC 10.1.3 Web Services, click Remove, and the click OK.
Generate the new JAX-WS Web service:
Right click the RapidService.wsdl
file under the following location in the RapidService project:
Application Sources > org.soademo.rapidservice > RapidService
Select Create Web Service from the context menu.
Oracle JDeveloper displays the Create Java Web Service From WSDL wizard.
Follow the instructions on the screen to create the new JAX-WS Web service:
Be sure to select Java EE 1.5, with support for JAX-WS Annotations on the Select Deployment Platform screen.
Modify the poItemsQuote
method in the RequestQuoteImpl.java
file as follows:
public Quote poItemsQuote(@WebParam(name = "param0", targetNamespace = "http://rapidservice.soademo.org/types/") List<Item> param0) { Long totalPrice = new Long(0); for (int i = 0; i < param0.size(); i++) { Item localItem = param0.get(i); totalPrice += localItem.getQuantity() * 110; } Quote priceQuote = new Quote(); priceQuote.setSupplierName("RapidDistributors"); priceQuote.setSupplierPrice(totalPrice.toString()); return priceQuote; }
Modify the orderQuote method in the RequestQuoteImpl.java
file, as follows:
public Quote orderQuote(@WebParam(name = "param0", targetNamespace = "http://rapidservice.soademo.org/types/") String param0, @WebParam(name = "param1", targetNamespace = "http://rapidservice.soademo.org/types/") String param1, @WebParam(name = "param2", targetNamespace = "http://rapidservice.soademo.org/types/") String param2, @WebParam(name = "param3", targetNamespace = "http://rapidservice.soademo.org/types/") String param3, @WebParam(name = "param4", targetNamespace = "http://rapidservice.soademo.org/types/") String param4) { Quote priceQuote = new Quote(); priceQuote.setSupplierName("RapidDistributors"); priceQuote.setSupplierPrice("5000"); return priceQuote; }
Save your changes to the RapidService project.
To compile and redeploy the Fulfillment project:
Right-click the project in the Application Navigator.
From the context-menu, select Make RapidService.jpr.
Right-click the project again and select Deploy > RapidService.
Oracle JDeveloper displays the first page of the Deployment wizard.
Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.
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.
This project is a Java EE Web services project. Before you proceed, refer to Section A.8.1, "About the CreditService, RapidService, and CustomerService Projects".
Before you can compile and deploy the project, there some changes you have to make in Oracle JDeveloper 11g.
To modify the CustomerService project in Oracle JDeveloper 11g, you must modify the following files in the /src/org/soademo/customerservice/
directory of the project:
business/Customerservice.java:
Remove "throws RemoteException"
from the finsCustomerById()
method.
client/CustomerServiceClient.java and business/CustomerServiceClient.java
Locate the section of the class file shown in Example A-1 and modify it so it reflects the changes shown in Example A-2.
Change the lookup to the following:
CustomerService customerService = (CustomerService)context.lookup( "CustomerService#org.soademo.customerservice.business.CustomerService");
business/CustomerserviceBean.java:
Modify this file so its contents reflects the changes shown in Example A-3.
Example A-1 Original CustomerService.java File
private static Context getInitialContext() throws NamingException { Hashtable en = new Hashtable(); // Standalone OC4J connection details env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory" ); env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" ); env.put( Context.SECURITY_CREDENTIALS, "welcome1" ); env.put(Context.PROVIDER_URL, "ormi://localhost:23791/CustomerService"); return new InitialContext( env );
Example A-2 Modified CustomerService.java File
private static Context getInitialContext() throws NamingException { Hashtable env = new Hashtable(); env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" ); env.put( Context.SECURITY_PRINCIPAL, "weblogic" ); env.put( Context.SECURITY_CREDENTIALS, "weblogic" ); env.put(Context.PROVIDER_URL, "t3://edith:7101"); return new InitialContext( env ); }
Example A-3 Updated CustomerServiceBean.java Class File
package org.soademo.customerservice.business; import javax.ejb.Remote; import javax.ejb.RemoteHome; import javax.ejb.Stateless; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.soademo.customerservice.persistence.Customer; @Remote @WebService(serviceName = "CustomerSvc", targetNamespace = "http://www.globalcompany.com/ns/customer") @Stateless(name="CustomerService", mappedName = "CustomerService") public class CustomerServiceBean implements CustomerServiceLocal, CustomerService { @PersistenceContext(unitName = "customerServiceUnit" ) private EntityManager em; public CustomerServiceBean() { } /** * @param entity * @return */ public Object mergeEntity(Object entity) { return em.merge(entity); } public Object persistEntity(Object entity) { em.persist(entity); return entity; } public Object refreshEntity(Object entity) { em.refresh(entity); return entity; } public void removeEntity(Object entity) { em.remove(em.merge(entity)); } /** <code>select object(cust) from Customer cust where cust.custid = :custid</code> */ @WebMethod public Customer findCustomerById(@WebParam(name = "custid", targetNamespace = "http://www.globalcompany.com/ns/customer") String custid){ // public Customer findCustomerById(String custid) { return (Customer)em.createNamedQuery("Customer.findCustomerById").setParameter("custid", custid).getSingleResult(); } // public String getCustomerStatus(String CustomerID) { @WebMethod public String getCustomerStatus(@WebParam(name = "CustomerID", targetNamespace = "http://www.globalcompany.com/ns/customer") String CustomerID){return findCustomerById(CustomerID).getStatus(); } // public String addNewCustomer(Customer customer) { @WebMethod public String addNewCustomer(@WebParam(name = "customer", targetNamespace ="http://www.globalcompany.com/ns/customer") Customer customer){ em.persist(customer); //making the change to return the customer id // that client application can use to query orders return customer.getCustid(); //return "New customer added sucessfully to customer database"; } // public Customer findCustomerByEmail(String email, String password) { @WebMethod public Customer findCustomerByEmail(@WebParam(name = "email", targetNamespace = "http://www.globalcompany.com/ns/customer") String email, @WebParam(name = "password", targetNamespace = "http://www.globalcompany.com/ns/customer") String password){ return(Customer)em.createNamedQuery( "Customer.findCustomerByEmail").setParameter("email", email).setParameter("password", password).getSingleResult(); } }
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>
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.
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:
Make the following changes to the SOAOrderBooking project in Oracle JDeveloper 11g:
Expand the SOAOrderBooking project, and open the SOA Content > ApproveOrder folder.
Double-click the ApproveOrder.task file, which defines the human approval task.
Double-click the Manager icon under the Assignment and Routing section, select User from the Identification Type drop-down menu, and enter weblogic
in the associated field.
Open the SOA Content folder, and double-click composite.xml.
Oracle JDeveloper displays the SOAOrderBooking composite in the SOA Composite Editor.
Double-click the icon that represents the Order reference.
This external reference represents the Order database adapter.
When you double-click this reference, Oracle JDeveloper displays the Adaper Configuration Wizard.
Follow the instructions in the wizard, and accept the default settings, except for the following changes:
Select soademo
as your database connection.
Set the JNDI name to eis/DB/soademoDS
.
Perform Steps 5 and 6 for the OrderSequence reference and the OrderStatus external references, which both also represents database adapters that must connect to the soademo database and schema.
Double click the SelectService reference.
Oracle JDeveloper displays the Update Reference dialog box.
Click on the WSDL icon next to the WSDL URL field to display the SOA Resource Browser.
Select Resource Palette from the drop-down menu, and then select SelectManufacturer in the Resource Palette.
Repeat Step 8 for the OrderFulfillment reference, but this time select the Fulfillment.OrderFulfillment_ep entry point in FulfillmentESB from the resource palette.
Save the change you made to the project.
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.
Alternatively, you can continue to reference the existing 10g Web services. For more information, see Section A.8.1, "About the CreditService, RapidService, and CustomerService Projects".
To modify the SOAOrderBooking project so it uses the newly upgraded RapidService, CreditService, and CustomerService Web services:
Locate the new WSDL URL for the upgraded Web services projects:
Open your Web browser and log in to the Fusion Middleware Control.
For example: host24.mycompany.com:7001/em
For more information, see "Getting Started Using Oracle Enterprise Manager Fusion Middleware Control" in the Oracle Fusion Middleware Administrator's Guide.
Open the Application Deployments folder in the Target Navigation Pane.
Click the SOADEMO-RAPIDSERVICE-RapidService-WS application in the list of deployed applications.
Fusion Middleware Control displays the Application Deployment page for the application you selected.
Click the Test icon for the SOADEMO-RAPIDSERVICE-RapidService-WS in the Web Services table in the Entry Points section of the page.
On the Test Web Services page, note the WSDL URL for the Web service.
Repeat steps c through e for the CreditService and CustomerService applications.
Modify the SOAOrderBooking composite with the new WSDL URLs:
Expand the SOAOrderBooking project and double-click composite.xml.
Oracle JDeveloper displays the SOAOrderBooking composite in the SOA Composite Editor.
Double-click the icon that represents the RapidService external reference in the right swimlane.
This external reference represents the RapidService Web service.
When you double-click this reference, Oracle JDeveloper displays the Update References dialog box.
Enter the new 11g WSDL URL in the WSDL URL field and click OK.
Repeat Steps c and d for the CreditValidationService and CustomerService external references.
Save your changes to the project.
If you upgraded the CustomerService project to 11g, then you must also modify the SOAOrderBooking.bpel
file to reflect the changes made to the CustomerService while upgrading it to 11g.
This involves reconnecting the Web services binding, and updating the customerServiceRequest
, customerServiceResponse
, and subsequent variable queries.
To compile and redeploy the SOAOrderBooking project:
Right-click the project in the Application Navigator.
From the context-menu, select Make.
The project should compile successfully.
Right-click the project again and select Deploy > SOAOrderBooking.
Oracle JDeveloper displays the first page of the Deployment wizard.
Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.
The OrderBookingESB project is the entry point to the SOA Order Booking application.
The OrderBookingESB project invokes the SOAOrderBooking project, which is a BPEL project that defines the main flow of the SOA Order Booking application.
It was created in 10g Release 3 (10.1.3) as an Oracle Enterprise Service Bus (ESB) project.
Before you can compile and deploy this project from Oracle JDeveloper 11g, you must make some changes:
To modify the OrderBookingESB project in Oracle JDeveloper 11g:
Expand the OrderBookingESB project and double-click composite.xml.
Oracle JDeveloper displays the OrderBookingESB composite in the SOA Composite Editor (Figure A-4).
Double-click the icon that represents the OrderBooking external reference in the right swimlane.
This external reference represents the OrderBooking Web service.
When you double-click this reference, Oracle JDeveloper displays the Update References dialog box.
Click the WSDL icon next to the WSDL URL field to display the SOA Resource Browser.
Select Resource Palette from the drop-down menu, expand the application server connection, and select the SOAOrderBooking > Client resource from the Resource Palette.
Save your changes to the project.
To compile and redeploy the OrderBookingESB project:
Right-click the project in the Application Navigator.
From the context-menu, select Make.
The project should compile successfully.
Right-click the project again and select Deploy > SOAOrderBookingESB.
Oracle JDeveloper displays the first page of the Deployment wizard.
Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.
The ApproveOrderTaskForm project is created automatically when you open and upgrade the SOA Order Booking application in Oracle JDeveloper 11g.
No changes are required to this project. However, to deploy this project, you must use the deploy it as an application and not as a project:
Select the ApproveOrderTaskForm project.
From the Application menu, select Deploy > ApproveOrderTaskFlow.
Oracle JDeveloper displays the first page of the Deployment wizard.
Follow the instructions on the wizard pages to deploy the project on the SoademoApplicationServer.
Oracle Enterprise Manager Fusion Middleware Control provides a Web-based management console that you can use to manage your Oracle SOA Suite composite applications.
To test the SOA Order Booking application in Fusion Middleware Control:
Log in to the Fusion Middleware Control for the Oracle WebLogic Server domain where you deployed your SOA Order Booking application projects:
The URL for Fusion Middleware Control is usually:
http://hostname:7001/em
For more information, see "Getting Started Using Oracle Enterprise Manager Fusion Middleware Control" in the Oracle Fusion Middleware Administrator's Guide.
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:
http://domain:port/integration/worklistapp
Figure A-11 Selecting XML Content in the Input Argument Section of the SOA Composite - Test Web Service Page
Figure A-12 Flow Trace of the SOA Order Booking Application in Fusion Middleware Control