The Oracle SOA product management team does a nice job of publishing a Pre-built Virtual Machine for SOA Suite. They also produce an exceptional Oracle SOA Suite 12.1.3 end-to-end tutorial. As I often use the solutions from that tutorial as a baseline for demonstrating other SOA features, such as BAM or API Management, I wanted to document the steps to getting the tutorial’s ValidatePayment composite deployed to the pre-built virtual machine. This primarily involves importing the sample data and configuring the ValidatePayment composite to use the compact domain configured with the VM rather than the integrated domain.
Step 1: Download Resources
- Download and import the Pre-built Virtual Machine for SOA Suite 12.2.1. Don’t worry, the 12.1.3 end-to-end tutorial will work just fine on 12.2.1.
- Download and extract the the Oracle SOA Suite 12.1.3 end-to-end tutorial and the Sample and tutorial database creation script from the Oracle SOA Suite Samples and Tutorials page.
Step 2: Configure the Database
Create a SOA_TUTORIAL User
- Start SQL Developer (use the icon on the destkop)
- Enter the following commands:
CREATE USER SOA_TUTORIAL IDENTIFIED BY SOA_TUTORIAL; GRANT CONNECT, RESOURCE TO SOA_TUTORIAL; GRANT UNLIMITED TABLESPACE TO SOA_TUTORIAL;
Import Tutorial Sample Data
- Start JDeveloper (use the icon on the desktop)
- Open the Databases Windows (Window > Database > Databases)
- Create a new IDE Connection:
- Connection Name: SOA_TUTORIAL
- Connection Type: Oracle (JDBC)
- Username: SOA_TUTORIAL
- Driver: thin
- Host Name: localhost
- SID: ORCL
- Test Connection
- Open e2e_1201_create_all_tables_oracle.sql in JDeveloper.
- Comment out the COMMIT at the end of the script as the JDBC driver will auto commit the changes.
- Select SOA_TUTORIAL in the connection dropdown in the upper right and press F5 to run the script.
- Close the e2e_1201_create_all_tables_oracle.sql script.
Step 3: Open the Validate Payment Solution in JDeveloper
The ValidatePayment solution provided with the tutorial is configured to use the integrated SOA server along with the JavaDB database that’s configured with the integrated server. We need to change the configuration to use the compact domain along with the Oracle Database we just configured.
- Expand SOASuite12c_Tutorial > e2e-1201-orderprocessing > solutions > ch2-validatePayment and extract e2e-1201-composites-ch2.zip.
- Open in JDeveloper e2e-1201-composites > e2e-1201-composites.jws. Select Yes on the Open Warning that the application is going to be migrated to 12.2.1.
Update the Database Adapter
- Open the ValidatePayment composite.
- Double-click the getPaymentInformation to start the Database wizard.
- Click Next and the wizard will complain about the missing connection.
- Click OK and then click the magnifying class to select the SOA_TUTORIAL connection we just established.
- Set the JNDI Name to eis/DB/SOA_TUTORIAL. We will configure this soon.
- Click Next to walk through the remainder of the wizard. Nothing else has to change. Click Finish at the end.
Update the Address Location
- Open SOA > WSDLs > ValidatePayment_concrete.wsdl. Select the validatePaymentPort service address and change the port from 7101 to 8001.
- Save the close the WSDL.
Step 4: Start the SOA Domain
- Open the SOA Domain folder on the desktop and click Start soa_domain Admin Server. Monitor the terminal window that opens and wait for startup to complete.
- Start the soa_domain SOA Server.
Configure the SOA_TUTORIAL Datasource
- Start Firefox.
- Use the WLS > WLS Admin Console – SOA and Insight Domain bookmark to open the Admin Console.
- Login using weblogic / welcome1.
- Select Data Sources.
- Create a New > Generic Data Source.
- Set the Name to SOA_TUTORIAL_DS and the JNDI Name to jdbc/SOA_TUTORIAL. Leave the Database Type as Oracle.
- Click Next and select *Oracle’s Drive (Thin XA) for Instance connections: Versions:Any for the Database Driver.
- Click Next and Next and set the following:
Database Name: ORCL
Host Name: localhost
Database User Name: SOA_TUTORIAL
Confirm Passord: SOA_TUTORIAL
- Click Next and Test Configuration. Ensure the test succeeded:
- Click Next and target the datasource to the soa_server:
- Click Finish.
Update the DB Adapter
Here we will map the JNDI name we configured in our composite, eis/DB/SOA_TUTORIAL, to the data source we just configured.
- Click Deployments.
- Find and click DbAdapter.
- Select the Configuration Tab and Outboud Connection Pools tabs.
- Click New.
- Select the javax.resource.cci.ConnectionFactory and click Next:
- Set the JNDI Name to eis/DB/SOA_TUTORIAL (which matches the name of the DB Adapter in our composite)
- Click Finish and OK to save the deployment plan:
- Return to Configuration > Outbound Connection Pools. Expland the javax.resource.cci.ConnectionFactory and click the eis/DB/SOA_TUTORIAL factory we just created:
- Set the XADataSourceName to jdbc/SOA_TUTORIAL. This maps the connection factory to the data soure we created earlier.
- Click Save.
- Click Deployments and find the DbAdapter again.
- Select the checkbox in the first column and click Update.
- Click Next and Finsh. You should see the message:
Step 5: Deploy Validate Payment
- Return to JDeveloper. Right-click the ValidatePayment project and select Deploy > ValidatePayment to open the Depoy wizard.
- Select Deploy to Application Server and click Next:
- Select Overwrite any existing composites with the same revision ID. This selection isn’t required for this initial deployment, but we will use it on subsequent deployments. Click Next.
- Select SOA_DOMAIN and click Next.
- Select soa_server1 and click Next and Finish.
- The Deployment – Log should indicate a successful deployment:
Step 6: Test Validate Payment Composite
- Use the EM > Oracle Enterprise Manager – SOA and Insight Domain bookmark in Firefox to open Enterprise Manager Fusion Middleware Control.
- Login using weblogic / welcome1.
- Using the Target Navigation menu on the left, switch to SOA > soa-infra (soa_server1)
- Switch to the Deployed Composites tab where you should find ValidatePayment.
- Select ValidatePayment and click the Test button.
- The tutorial includes sample payload we can use to test the service. Under the Request tabl of the Test Web Service page click the Browse button and open SOASuite12c_Totorial > e2e-1201-orderprocessing > sample_input > PaymentInfoSample_Authorized_soap.xml:
- Click Test Web Service. You should see a response status as “Authorized”:
Congratulations, you have successfully deployed the Validate Payment composite to the SOA 12c virtual machine.