In this tutorial, you learn how to configure all the components required to call Oracle Tuxedo services from Oracle SOA Suite, using the Oracle Service Architecture Leveraging Tuxedo (SALT) product.
After completing this course, you should be able to:
Approximately 8 hours including product download and installation time.
Oracle SALT enables developers and administrators to expose Tuxedo services as Web services. SOA Suite can leverage its ability to act as a Web service client to integrate Tuxedo service calls into its various product offerings, such as BPEL PM process flows.
This OBE guides you through constructing an application that demonstrates a Web application that acts as the front end for a SOA Suite BPEL process that manages calling Tuxedo Web services using the SALT SOAP server gateway. The back end for the uBike application is written in Tuxedo. Read the uBike Tuxedo Overview page for detailed information about the back -end services offered on the Tuxedo side of this application.
In this tutorial, you begin by creating a WebLogic Server domain that includes the extensions for running SOA Suite. This is going to be a single server domain. Next, you configure the SALT environment to expose uBike Tuxedo services as Web services that can be called by BPEL, and test that your Web services are working using soapUI. Then, you create, deploy, and test the BPEL SOA composite application that calls the uBike Web services. Finally, you import and modify the uBike Web application front end that calls the BPEL process to test the end-to-end solution.
Your company has a pre-existing application, called uBike, that is implemented using Tuxedo. The company is investigating how to leverage this IT investment to work within their overall SOA strategy without making major and expensive changes. The company uses Oracle SOA Suite and WebLogic Server for their application server tier, and has decided to use Oracle SALT to expose their existing uBike Tuxedo services as Web services that can be easily consumed by both products. This strategy integrates existing technologies to enable the application server tier to freely use Tuxedo services with very little change.
The diagram below displays the high-level architecture of the solution:
The following is a list of software requirements:
NOTE: Oracle 10g products should be installed into a separate MIDDLEWARE_HOME than Oracle 11g products.
Before starting this tutorial, you should have performed the following in the order specified:
. | Installed Oracle XE 10g Universal Database, or other supported Oracle database for SOA Suite 11g PS1. The Oracle XE database was chosen for its smaller footprint and the likelihood that most people would have this database installed on their machine.
Make sure to run these steps to increase Oracle XE's processing capabilities for use with this lab: Open a command window and run the following commands after the database is installed:
To verify your new settings run the following commands:
where name in ('processes', 'sessions', 'transactions'); Run the following commands to exit sqlplus
|
---|---|
. | Installed and run the Repository Creation Utility (RCU) 11.1.1.2.0 to create the schemas for SOA Suite (instructions) NOTE: If you observe a message while running this tool such as, "The database you are connecting to is not a supported version...", simply ignore the message and processing should continue successfully. |
. | Installed Oracle Tuxedo 10gR3 (instructions) |
. | Installed Oracle SALT 10gR3 (instructions) |
. | Installed Oracle SALT 10gR3 8252856 Patch (instructions) |
. | Installed Oracle WebLogic Server 11g (instructions) |
. | Installed JDeveloper 11g (instructions) and JDeveloper Extensions for SOA Applications 11g (instructions) |
. | Installed Oracle SOA Suite 11g PS1 (instructions) |
. | Completed the Using the Oracle Service Bus Tuxedo Transport OBE which prepares the following dependencies for this OBE:
|
The default domain configuration for SOA Suite involves creating a WebLogic AdminServer, and two managed servers for SOA Suite and BAM. We are not using BAM in this tutorial. You will create a domain that includes WebLogic and SOA Suite components all within a single JVM environment for this lab. This lowers the overall memory footprint required to run the tutorial, making it possible to run on machines with less physical RAM.
Follow the steps below to create your single-server domain:
. |
Run the Configuration Wizard: Click Start > Oracle SOA 11g - Home 1 > Configure Application Server to start the Configuration Wizard.
|
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
. |
Welcome: Choose Create a new WebLogic domain and click the Next button.
|
||||||||||||||||
. |
Select Domain Source: Select the Oracle SOA Suite and Oracle Enterprise Manager check boxes, and click the Next button. All dependent products are selected automatically.
|
||||||||||||||||
. |
Specify Domain Name and Location: Create the uBike domain at C:\uBike\uBikeSOADomain to keep your lab work in a single location. If you have been following the directory structure that this tutorial uses, then your Tuxedo uBike application is located in C:\uBike. Enter the values below and click the Next button:
|
||||||||||||||||
. |
Configure Administrator User Name and Password: Enter weblogic as the user name, welcome1 as the password, and click the Next button.
|
||||||||||||||||
. |
Configure Server Start Mode and JDK: Keep the default values of Development Mode and the Sun JDK 1.6.0_x and click the Next button.
|
||||||||||||||||
. |
Configure JDBC Component Schema: Select all of the check boxes for the component schemas to allow editing for all entries at once. Set the values as specified in the table below, and click the Next button.
|
||||||||||||||||
. |
Test Component Schema: The next screen tests the database configurations you just set. Ensure that all connection tests are successful, and click the Next button.
|
||||||||||||||||
. |
Select Optional Configuration: Select the Managed Servers, Clusters and Machines check box to modify these settings for your domain, and click the Next button.
|
||||||||||||||||
. |
Configure Managed Servers: You should see a managed server entry, called soa_server1. Delete this entry, and click the Next button.
|
||||||||||||||||
. |
Configure Clusters: There are no clusters to configure so just click the Next button.
|
||||||||||||||||
. |
Configure Machines: Leave the default LocalMachine settings, and click the Next button.
|
||||||||||||||||
. |
Assign Servers to Machines: Assign the AdminServer to LocalMachine, and click the Next button.
|
||||||||||||||||
. |
Configuration Summary: Note that all SOA Suite components are listed under the AdminServer. When ready, click the Create button.
|
||||||||||||||||
. |
Creating Domain: Examine the progress and output to determine that your domain was created successfully, do not select the Start Admin Server check box, and click the Done button.
|
||||||||||||||||
. |
Change the memory settings of the AdminServer:
Change DEFAULT_MEM_ARGS=-Xms512m -Xmx1024m to Change DEFAULT_MEM_ARGS=%DEFAULT_MEM_ARGS% -XX:PermSize=128m -XX:MaxPermSize=512m to Save your changes and continue. NOTE: You can try higher settings for maximum heap sizes if your machine will allow. This environment would not allow higher settings.
|
||||||||||||||||
. |
Run SOA 11g Server: Double-click C:\uBike\uBikeSOADomain\startWebLogic.cmd to start the server. Wait a few minutes until the the server shows a RUNNING state.
|
. |
Extract installation files:
The uBikePlugin folder contains files that relate to configuring SALT, and the uBikeSOAClient folder contains an ant build script that compiles Web service client classes from your SALT WSDL. The table below describes the purpose of each file:
|
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
. | Modify setenv.cmd:
Edit the C:\uBike\setenv.cmd file and make the following changes:
@set XSDDIR=%APPDIR%\uBikePlugin
@set PATH=%PATH%;%TUXDIR%\bin;%APPDIR%\uBikePlugin
@set SALTCONFIG=%APPDIR%\SALTCONFIG |
. | Examine BikeList.xsd:
Open C:\uBike\uBikePlugin\BikeList.xsd to examine its contents. You will notice that this file has changed somewhat from the previous OSB Tuxedo Transport OBE. The data is basically the same, but simplified and changed to work with SALT. This schema represents the XML data to which we will map the SEARCHINVENTORY service's output FML32 fields. You will see how we reference this schema in the next step.
|
---|---|
. |
Examine uBikeSOA.meta:
Just as you had to create a metadata repository to define the SEARCHINVENTORY service contract, SALT requires that you define a service contract for all Tuxedo services you want to expose as Web services. In this OBE we will handle the transformation of FML32 fields to the BikeList XML schema types using the SALT custom mapping plugin feature. Open the C:\uBike\uBikePlugin\uBikeSOA.meta file and examine its contents. The service contract for SEARCHINVENTORY is slightly different in that all the fields are now configured as input only, and no output fields are defined. The outbufschema parameter references the BikeList element within the BikeList.xsd file. SALT will try to find the BikeList element within the http://www.uBike.org/bikelist namespace by searching all files that are specified using the XSDDIR and XSDFILES environment variables. There is no need to define output fields for a service when you configure the outbufschema parameter to use an external schema. It is also possible to define inbufschema and errbufschema parameters. You should note that there are three other services defined in the uBikeSOA.meta file: ORDERITEM, MODIFYITEM, and SOLDITEM. Each of these services uses simple input and output parameters, so none of them use an external schema. View the image below to learn more about the outbufschema parameter:
|
. |
Create metadata repository:
Double-click the C:\uBike\DOSPrompt.cmd file to open a command window.
setenv.cmd
tmloadrepos -e -i uBikeSOA.meta -y ..\metarepo
|
. |
Examine and modify uBike.wsdf:
Open the C:\uBike\uBikePlugin\uBike.wsdf file and examine its contents. The WSDF file defines Web service binding details for the Tuxedo services you want to expose as Web services. The uBike.wsdf file defines a Web service that exposes the SEARCHINVENTORY, ORDERITEM, MODIFYITEM, and SOLDITEM Tuxedo services offered by the uBike application. The SEARCHINVENTORY service has a message handler, called BikeConvert, configured to map its output FML32 fields to the XML elements defined in BikeList.xsd. Additionally, the uBike.wsdf file is configured to use the "doc literal" style of SOAP binding, and specifies the endpoint address of http://hostname:8080/uBike where the Web service will be hosted. The endpoint is given an ID of uBike_GWWS_HTTPPort", which is a string value that must match in the corresponding uBike.salt file covered in the next section.
<Endpoint address="http://<your-host_name>:8080/uBike" id="uBike_GWWS_HTTPPort"/>
It is important that this file is correct as it will be referenced by the uBike.salt file, and is used when running the wsloadcf command to create the binary SALTCONFIG file in the next section.
|
---|
. |
Examine uBike.salt:
Open the C:\uBike\uBikePlugin\uBike.salt file and examine its contents. The uBike.salt file is a text file that is converted to a binary SALTCONFIG file using wsloadcf. The binary SALTCONFIG file location is determined by the SALTCONFIG environment variable that you set in the setenv.cmd file. When you run wsloadcf, the uBike.salt file is read and the binary SALTCONFIG file is created. This file is read by the SALT GWWS server at run time to get the configuration for the Tuxedo services it will expose as Web services. The uBike.salt file is where the configuration defined in the uBike.wsdf file is realized. The uBike.wsdf file is imported, and becomes part of the overall SALT configuration. The WSGateway element defines the gateway instance, providing a unique ID that is used by the SALT GWWS server, and the binding configuration points to use from the uBike.wsdf file. The System element defines the configuration for anything that is system-specific, such as the name of the custom mapping plugin library to load when the GWWS server starts. View the image below to learn more about the uBike.salt configuration:
|
---|---|
. |
Run wsloadcf:
wsloadcf -y uBike.salt
|
. |
Examine mapping_ids.c:
The mapping_ids.c file provides information to register the custom mapping plugin. It registers the ID, which is a set SALT name, P_CUSTOM_TYPE, and the name of the plugin, BikeConvert, which maps to the MsgHandler element name in the uBike.wsdf file. Open the C:\uBike\uBikePlugin\mapping_ids.c file and examine its contents.
|
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
. |
Examine mapping_uBike.cpp:
Most of the code in the mapping_uBike.cpp file is boilerplate code that does not need to be changed. The code is already completed for you for this tutorial, and you are examining it to learn by seeing a working example. The mapping_uBike.cpp file implements four (4) functions. The table below describes each function:
Open the C:\uBike\uBikePlugin\mapping_uBike.cpp file and examine its contents. Find each of the functions listed above (in order) and examine what they do to become familiar with what each should look like.
|
||||||||||
. |
Build mapping_plugin.dll:
Within the same command window, enter the following command within the C:\uBike\uBikePlugin folder to build the mapping_plugin.dll library: nmake Now that all of the SALT artifacts have been configured and created, you can modify the uBike.ubb file to add the TMMETADATA and SALT GWWS SOAP servers.
|
. |
Modify uBike.ubb:
Open the C:\uBike\uBike.ubb file in a text editor.
SOA
TMMETADATA NOTE: The TMMETADATA server must be configured to start before the GWWS server. This is because the GWWS server calls services that are advertised by the TMMETADATA server to access the service contract information contained in the binary metadata repository. Your file should look similar to the following:
|
---|---|
. |
Reload TUXCONFIG:
In the same command window, enter the following to reload the TUXCONFIG file: tmloadcf -y uBike.ubb
|
. |
Run Tuxedo :
In the same command window, enter the following to start the Tuxedo domain: tmboot -y Examine the ULOG file for today's date in the C:\uBike folder to verify that the GWWS server loaded the library correctly as shown in the screenshot below: Now that Tuxedo is started with its new SALT configuration, you can test your SALT Web services to see that your uBike Tuxedo services are being called and operate as expected.
|
. |
Test GWWS server WSDL and XSD configuration:
http://<your-host-name>:8080/wsdl View the image below to see an excerpt of the WSDL file that relates to the BikeList.xsd file:
http://<your-host-name>:8080/xsd/BikeList.xsd View the image below to see that the BikeList.xsd schema matches the one we configured with SALT: Now that you have a valid WSDL that uses the BikeList schema, you can use soapUI to test the Web services themselves.
|
---|---|
. | Run soapUI from the Start menu:
Open soapUI by clicking Start>soapUI 3.0.1>soupUI-3.0.1.
|
. | Create soapUI workspace:
Right-click the Projects node in the left-hand pane, and select New Workspace. Enter uBikeSOA as the name of the workspace and click the OK button. Select the location where to save the workspace file, such as C:\uBike\SOAPUI.
|
. | Create soapUI project:
Right-click the uBikeSOA workspace node in the left-hand pane, and select New soapUI Project. Enter uBikeSOAProject for the project name and http:/<your-host-name>:8080/wsdl for the Initial WSDL property, and click the OK button. NOTE: If this step fails, and your Tuxedo servers are running, keep trying a few times by clicking the OK button again. Sometimes it takes a few tries.
|
. |
Test SEARCHINVENTORY:
Expand the SEARCHINVENTORY node in the uBikeSOAProject and double-click the Request1 node to open the SOAP request and response payload window. Modify the payload contents to send a request to the SEARCHINVENTORY service with a SKU element of RJ4500. Your payload should look similar to the payload in the image below: Click the icon to submit the request to the SEARCHINVENTORY service. You should see a list of bicycles returned in the response window as shown in the image below: Now that you have validated that the SEARCHINVENTORY service is working properly, let's test the ORDERITEM service. NOTE: If you like, you can open the Tuxedo administration client, tmadmin, to monitor that your Tuxedo services are actually being called. The tmadmin command used to monitor Tuxedo services is called printserver, or psc for short.
|
. |
Test ORDERITEM:
Expand the ORDERITEM node in the uBikeSOAProject and double-click the Request1 node to open the SOAP request and response payload window. Modify the payload contents to send a request to the ORDERITEM service with the following elements:
Your payload should look similar to the payload in the image below: Click the icon to submit the request to the ORDERITEM service. You should see a status message returned in the response window as shown in the image below: Examine the data returned in the STATUS element returned. It informs you of the successful status of entering a new bike into the inventory, as well as the new SERIALNO for the inserted bike record. If you execute the SEARCHINVENTORY service again, you should see this new bike appear at the end of the response as shown in the image below: Now that you have validated that the ORDERITEM service is working properly, let's test the MODIFYITEM service.
|
. |
Test MODIFYITEM:
Record the SERIALNO value returned by the ORDERITEM service. Expand the MODIFYITEM node in the uBikeSOAProject and double-click the Request1 node to open the SOAP request and response payload window. Modify the payload contents to send a request to the MODIFYITEM service with the following elements:
Your payload should look similar to the payload in the image below: Click the icon to submit the request to the ORDERITEM service. You should see a status message returned in the response window as shown in the image below: Examine the data returned in the STATUS element returned. It informs you of the successful status of modifying a bike in the inventory, as well as the SERIALNO for the updated bike record. If you execute the SEARCHINVENTORY service again, you should see the updated bike information at the end of the response as shown in the image below: Now that you have validated that the MODIFYITEM service is working properly, let's test the last service, SOLDITEM.
|
. |
Test SOLDITEM:
View the bicycle list returned by the SEARCHINVENTORY service. Locate a bicycle that is in stock <INSTOCK>Y</INSTOCK>. Record the SERIALNO value of this bicycle. The SOLDITEM service is going to delete this record from the inventory. Expand the SOLDITEM node in the uBikeSOAProject and double-click the Request1 node to open the SOAP request and response payload window. Modify the payload contents to send a request to the SOLDITEM service with the following elements:
Your payload should look similar to the payload in the image below: Click the icon to submit the request to the SOLDITEM service. You should see a status message returned in the response window as shown in the image below: Examine the data returned in the STATUS element returned. It informs you of the successful status of deleting a bike from the inventory, as well as the SERIALNO for the deleted bike record. Execute the SEARCHINVENTORY service again, with the payload shown in the image below, using your SERIALNO value. You should see that the deleted bike information is not returned in the response as shown in the image below: Now that you have verified that all your Tuxedo services, associated SALT Web services, and mapping plugin are functioning correctly, you can begin working on the SOA Suite aspect of the tutorial.
|
To create, configure, and test a BPEL process that calls the SALT Web services, perform the following steps:
. | Create SOA Application:
Open JDeveloper Studio 11g, and click New Application... Enter the following data on the Name your application dialog and click the Next button.
Enter a project name of uBikeComposite on the Name your project dialog , leave the other parameters at the default settings, and click the Next button. On the Configure SOA Settings dialog, select Composite With BPEL and click the Finish button. This creates your SOA Application, opens the composite.xml file for your application, and then automatically opens the Create BPEL Process configuration wizard because you selected BPEL as part of your composite's settings. Open Windows Explorer and browse to C:\uBike\uBikeJDev\uBikeSOAApplication. This is your workspace folder for this tutorial. The uBikeComposite project can be seen in this folder now. All other projects that are created within this application will be stored in this location.
|
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
. |
Create BPEL Process:
On the BPEL Process dialog, enter the following parameters, and click the OK button.
Now you should see the OrderItemBPELProcess.bpel file displayed in JDeveloper as follows:
|
. | Add a Web service reference to SOA composite:
Click the composite.xml tab to display the SOA composite design view. Drag the Web Service component from the Component Palette to the External References column in the design view to add and configure your uBike service to the composite. In the Web Service dialog, enter the following values, and click the OK button.
When the Localize Files dialog appears, make sure Maintain original directory structure for imported files and Localize external references are both selected as shown in the image below. Since you elected to copy the WSDL and its dependent artifacts, such as BikeList.xsd, you need to ensure that the dependency between these two files is maintained by keeping them in the same directory structure. In this case, they are in the same directory, and this results in keeping them in the same directly instead of moving the BikeList.xsd file into the SOA composite's xsd folder. Click the OK button when finished. Your screen should now look like the following image: You just imported the uBike service for use in your SOA composite, but it isn't ready to use yet. The next step shows you how to make it work with your BPEL process.
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
. |
Configure BPEL process to use Web service partner link:
On the composite.xml design view, drag a line from the icon of the OrderItemBPELProcess component to the icon of the uBikeSALTWebService component to add it as a partner link to the BPEL process. When you are done, your screen should look like the following image: Double-click the OrderItemBPELProcess component in the Components column to open the BPEL design view of the BPEL process. Drag the Invoke BPEL activity from the Component Palette to the area between the receiveInput and replyOutput activities. Your screen should look like the image below: Drag a line from the icon from the Invoke_1 activity to the uBikeSALTWebService component in the Partner Links column as depicted in the image below. This will cause the Edit Invoke wizard to appear. In the Edit Invoke screen, enter the following values. When you are finished, click the OK button.
Your screen should look like the following image: Now that the uBike service has been configured for the BPEL process, you need to map the input and output variables from your SOA composite to the uBike service.
|
||||||||||||||
. | Map BPEL process input and output payload to uBike Web service payloads:
Drag the Assign activity from the Component Palette between the receiveInput and InvokeOrderItem components. Your screen should look like the following image: Repeat the assign activity for the output parameters, as shown in the image below. Before you can perform any data mapping, you need to modify the schema that determines the payload of the input data so that it can match what is expected by the Web service. You do this by opening the schema file that is related to this process, which in this case is called OrderItemBPELProcess.xsd. Open this file in JDeveloper by expanding the uBikeComposite/xsd folder, and double-clicking the file name. Your screen should like like the following image: Change the input element by clicking the name of the element so that it is highlighted, and then enter SKU as the new element name. For the next two elements, drag the element type from the Schema Components list onto the icon in the design view of the schema two times. Use the table below to set the name and type of each element and compare them to the image below. To change the type of an element, right-click the element and select Set Type. When you are done, you can close the schema file and continue working on the OrderItemBPELProcess.bpel file.
Double-click the Assign_1 activity in the BPEL design view to map the input parameters from the SOA composite service to the uBike service. In the Assign dialog, click the icon and select Copy Operation... The input variable name for the SOA composite entry point is called, inputVariable. The input variable name for the uBike service is called, InvokeOrderItem_ORDERITEM_InputVariable. Map the SKU, SIZE, and COLOR elements from the inputVariable schema to the InvokeOrderItem_ORDERITEM_InputVariable schema as shown in the image below. You will need to perform a separate copy operation for each element. Your screen should like the following image when all three copy operations are completed. Click the OK button to continue. Double-click the Assign_2 activity in the BPEL design view to map the output parameters from the uBike service to the SOA composite service. In the Assign dialog, click the icon and select Copy Operation... Map the InvokeOrderItem_ORDERITEM_OutputVariable STATUS element to the outputVariable result element, and click the OK button. Click the OK button on the Assign dialog to return to the BPEL process view. You have completed the BPEL process creation and configurations steps. Now you are ready to deploy and test the component on the application server.
|
. |
Open Application Server Connection Wizard:
In JDeveloper, click File > New... Select General > Connections > Application Server Connection and click the OK button. This opens up the Create Application Server Connection Wizard.
|
---|---|
. | Create Application Server Connection: Step 1 of 5:
Enter MyWebLogicConnection as the name of this connection. Leave the default Connection Type as WebLogic 10.3, and click the Next button. |
. | Create Application Server Connection: Step 2 of 5:
Enter weblogic as the username, welcome1 as the password for this connection, and click the Next button. |
. | Create Application Server Connection: Step 3 of 5:
Enter uBikeSOADomain for WebLogic Domain, leave the rest of the fields at their default values, and click the Next button. |
. | Create Application Server Connection: Step 4 of 5:
On the Test page, click the Test Connection button to see if JDeveloper can connect to your application server domain. Your domain must be running for this step to work. Click the Next button to continue. |
. | Create Application Server Connection: Step 5 of 5:
On the Finish page, review that your connection has been created successfully, and click the Finish button. |
. |
Disable JDeveloper Proxy Settings:
Click Tools > Preferences > Web Browser and Proxy, and deselect the Use HTTP Proxy Server if it is set. This can cause your deployment to fail if it is set. Click the OK button.
|
---|---|
. |
Deploy uBikeComposite:
Right-click the uBikeComposite project in the Application tab, and select Deploy > uBikeComposite...
|
. |
Deployment Action:
Select Deploy to Application Server and click the Next button.
|
. |
Deploy Configuration:
Select the Overwrite any existing composites with the same revision ID check box, leave all other fields as their default, and click the Next button.
|
. |
Select Server:
Select MyWebLogicConnection as the Application Server Connection to use, and click the Next button.
|
. |
SOA Servers:
Select the Admin Server check box, and click the Next button.
|
. |
Summary:
Review the configuration and click the Finish button.
|
. |
Authorization request:
When JDeveloper prompts you for login credentials, enter weblogic for the username and welcome1 for the password. Click the OK button to submit.
|
. |
Monitor SOA Log:
JDeveloper begins to build the uBikeComposite application. Click the SOA tab to view the progress of the build. If you see some warnings or errors regarding an unexpected namespace:id you can ignore them for now.
|
. |
Deployment Log:
Click the Deployment tab to view the progress of the deployment process. Make sure there are no deployment errors.
|
. | Open Enterprise Manager to Test uBikeComposite:
|
. | Open Test Service Page:
Click the Test button to open the test page for uBikeComposite.
|
. |
Enter Test Data:
|
. |
Review Results:
Click the Test Web Service button to run the test. You should see a success message showing that the service has been called successfully, and the new SERIALNO value of the newly inserted bicycle record as shown in the image below: Now you have successfully deployed and tested your SOA composite that calls Tuxedo Web services using SALT. The next section guides you through configuring a Web application to call the BPEL process within your SOA composite, which will in turn call your Tuxedo ORDERITEM service, using the SALT gateway.
|
This section guides you through adding the uBikeWeb application to your JDeveloper workspace, reviewing its code to become familiar with how it works, and developing the missing parts of the application that complete the end-to-end integration of this tutorial.
. | Install uBikeWeb Application:
Extract the contents of uBikeWeb.zip to C:\uBike\uBikeJDev\uBikeSOAApplication. This should create a folder structure with uBikeWeb directly within the uBikeSOAApplication folder as shown below:
|
---|---|
. |
Open uBikeWeb Project:
In JDeveloper, right-click uBikeSOAApplication and select Open Project... Browse to and select the C:\uBike\uBikeJDev\uBikeSOAApplication\uBikeWeb\uBikeWeb.jpr file, and click the Open button. In the JDeveloper Application tab, expand the uBikeWeb application so it looks like the image below: You have the uBikeWeb application opened within your JDeveloper workspace, but it is missing a few key aspects of the code required to call SALT Web services directly, and to call the entry point into the BPEL process that calls the ORDERITEM service through the SALT gateway. The next section takes you through the steps required to accomplish these tasks.
|
. |
Build & Install uBike SALT Web Service Client Classes:
NOTE: If this fails, keep trying a few times until it works. There is a known issue in that
|
---|---|
. |
Build & Install uBike BPEL Web Service Client Classes:
Within the same command shell window that was used in the last step:
|
. | Modify uBikeWeb Project Libraries:
|
. | Modify uBikeController.java Initialization Code:
import ubikeBPEL.client.*;
private Orderitembpelprocess_Client_Ep BPELService = null;
BPELService = new Orderitembpelprocess_Client_Ep_Impl("http://localhost:7001/soa-infra/services/default/uBikeComposite/orderitembpelprocess_client_ep?WSDL");
|
. | Review uBikeController.java
doPost() Code:
Scroll further down the file and find the servlet's doPost() method. Notice that the caller sets an OPCODE parameter that is used to control which business method to invoke. This is the processing center of the uBikeController class. The default business method is searchInventory, which either returns the entire list of bicycle records in the database, or only the matching records for a SKU parameter that has been passed in. When each of the other business methods are invoked, they set a STATUS attribute in the response, and the searchInventory method is run again to return the current view of the database to the caller.
|
. |
Review uBikeController.java searchInventory() Code:
The searchInventory method takes a SKU parameter to return any matching records found in the database. If the SKU is empty or NULL, then all bicycle records in the database are returned. This service uses a direct Web service call to the SALT gateway. You reviewed that SALT mapping plugin earlier. This method makes use of that plugin to map the FML fields returned by the SEARCHINVENTORY Tuxedo service into the list of bike records defined in BikeList.xsd. This method returns that list of bikes to the caller.
|
. | Review uBikeController.java soldItem() Code:
The soldItem business method is also a direct call to the Web services defined by the SALT gateway. It takes the SERIALNO of a bicycle record, and removes that record from the database. The STATUS of the operation is placed in the response, and sent back to the caller.
|
. | Review uBikeController.java orderItem() Code:
The orderItem business method takes three parameters, SKU, size, and color. These are the same parameters that you created for the BPEL Web service entry point parameters. This method gets those parameters from the request, and needs to populate them into the Web service request to call your BPEL process. |
. | Modify uBikeController.java orderItem() Code:
String status = process.process(SKU, size, color);
|
. |
What about the modifyItem() Code?
This method was intentionally left unimplemented. As a bonus exercise, you can optionally develop the JSP page and servlet code required to call the MODIFYITEM Web service. There is no solution or instruction on how to develop the functionality of the uBike modify item feature.
|
. |
Open Deployment Profile for uBikeWeb:
In JDeveloper, right-click the uBikeWeb project, and select Project Properties...
|
---|---|
. |
Edit Deployment Profile for uBikeWeb:
On the Project Properties dialog, select Deployment in the left-hand pane, and then click the Edit button to edit the uBikeWebApp deployment profile. In the Edit WAR Deployment Profile Properties dialog, select Library Dependencies in the left-hand pane, then select the check boxes for UBikeSOAClient.jar and UBikeBPELClient.jar. Make sure all other check boxes are not selected. This step is required, because otherwise JDeveloper will try to include all of the build-time libraries in the deployment itself. This increases the footprint of the deploy, and more importantly causes the deployment to fail as several of these libraries are running on the system classpath as part of the running application server. Click the OK button twice to return to the JDeveloper IDE.
|
. |
Deploy uBikeWeb to WebLogic Server:
Now that the deployment profile has been configured properly, you can deploy uBikeWeb to the server. In JDeveloper, right-click the uBikeWeb project, and select Deploy>uBikeWebapp... The Deployment Wizard appears. On the Deployment Action dialog, select Deploy to Application Server, and click the Next button. On the Select Server dialog, select MyWebLogicConnection, deselect the check box for the Deploy to all server instances in the domain option, leave all other fields at their default values, and click the Next button. Manually selecting which server to deploy to is important because sometimes JDeveloper will mistakenly try to deploy to JMS servers. On the Server Instances dialog, select the AdminServer entry, and click the Next button. On the Summary dialog, review your settings, and click the Finish button when done. Monitor the Deployment log by clicking on the Deployment tab to ensure that the deployment is successful. Congratulations! Now all development for the application should be complete, and you are ready to test the complete end-to-end integration.
|
Perform the following steps to test the end-to-end integration of SOA Suite, BPEL, Tuxedo, and SALT:
. |
Open uBikeWeb Application:
Open a web browser and go to http://localhost:7001/uBike/index.jsp to open the uBike Web Application. When you first run this page, the uBike Web application makes a call to Tuxedo via a direct call to the SALT gateway Web service endpoint. This call returns a list of bicycle records that is displayed on the page as shown in the image below. If you can see a list of bicycles in your Web browser, then this call is working successfully. You can test it again by selecting a SKU in the Search drop down list box. This will only return a list of bicycles that match the selected SKU.
|
---|---|
. |
SOLDITEM Test:
Find a bicycle in the list of bicycles that is in stock (Instock: Y), and click the Sold button for that record. This causes the Web application to call the SOLDITEM Tuxedo service directly using the SALT gateway. When the service is called, the bicycle list is refreshed, and a status message is displayed near the top of the page. Make sure that the bicycle record you performed the operation on is no longer in the list. This can be done by verifying that the serial number in the status message no longer exists in the list of bicycles. Notice in the image above that there is a record for serial number 147890000002, but in the image below that record is gone, and the status indicates that the sold item operation was successful for that serial number.
|
. |
ORDERITEM End-to-End Integration Test:
Now comes the real test, the end-to-end integration test of BPEL with Tuxedo SALT Web services.
SKU: RJ4500
CONGRATULATIONS! You have completed the 'Calling Tuxedo from SOA Suite' OBE!
|
This section contains instructions for installing the solutions for this tutorial. Please note that not all aspects of the tutorial contain a canned solution, and may require manual steps that are included in this tutorial. All required software installations must be completed before attempting to use any solution materials.
Solution File |
Instructions |
---|---|
Install Tuxedo uBike Environment |
|
Create uBike SOA Domain | |
JDeveloper Solution |
|
Run End-to-End Solution |
|
Congratulations! You have successfully completed this OBE tutorial.
Oracle SALT exposes Tuxedo services as Web services, and is a bidirectional gateway to and from Tuxedo applications. This enables SOA Suite applications to call Tuxedo services as part of an Enterprise SOA application. Now you can implement your own solutions that use these technologies together.
In this tutorial, you should have learned how to:
Check back on OTN for more OBE tutorials that build on this example to demonstrate other Tuxedo product integration examples.