Java CAPS Sample Documentation


<font color="red">Working with the Oracle Java CAPS JBI Samples for Oracle Service Bus</font>

Working with the Oracle Java CAPS JBI Samples for Oracle Service Bus


The following procedures provide general instructions for working with the Oracle Service Bus (OSB) sample projects and performing tasks using the Oracle Service Bus Console. Documentation for Oracle Service Bus is available at http://www.oracle.com/technetwork/middleware/service-bus/documentation/index.html.

Overview

The purpose of the sample projects provided for OSB and Java CAPS is to show you how to use Java CAPS JBI projects with Oracle Service Bus. The sample includes one Java CAPS project that uses the BPEL Service Engine (JBISyncBPEL) whose web service you can call from an Oracle Service Bus project. It also includes the corresponding Composite Application for the BPEL project.


Installing and Configuring the Sample Projects

Java CAPS sample JBI projects are provided on the Java CAPS Sample Code page. The ZIP file includes one BPEL project and one Composite Application.


Installing the Sample Projects

  1. Download JBISync.zip.

    This file is also available from the Java CAPS sample code site under the Oracle Service Bus tab.

  2. Extract the downloaded file into a temporary directory.

  3. Launch NetBeans.

  4. Right-click in the NetBeans Projects window, and select Open Project.

    The Open Project dialog box appears.

  5. In the Look In field, navigate to the temporary directory where you extracted the ZIP file, and then navigate to JBISync\JBI.

  6. Select the JBISyncPBEL and SynchronousJBI projects, and then click Open Projects.

    The projects appear in the project tree in the Projects window.


Deploying the Composite Application

This procedure includes deploying the Java CAPS project to the GlassFish server. Before you begin, make sure the GlassFish server is running. You can start the server by right-clicking GlassFish v2.x under the Servers node in the NetBeans Services window.

  1. In the NetBeans Projects window, right-click JBISyncBPEL and then select Clean and Build.

  2. In the NetBeans Projects window, right-click SynchronousJBI and then select Clean and Build.

  3. In the NetBeans Projects window, right-click SynchronousJBI and then select Deploy.

    You may need to specify a target GlassFish server for the application. If so, a dialog appears giving you a list of servers from which you can select.


Configuring Oracle Service Bus

For this procedure, you will create and test a routing scenario for the Java CAPS web services implemented by the sample BPEL project you deployed earlier. Use the Oracle Service Bus Console to perform the following tasks:

Creating the Oracle Service Bus Project for the BPM Project

  1. Log in to the OSB web console.

    The URL is http://hostname:port/sbconsole. The default port number is 7001, the default user name is weblogic, and the default password is welcome1.

  2. In the Change Center in the upper left, click Create to start a new WebLogic session.

  3. In the lower left, click Project Explorer. In the Project page that appears, enter JBISyncBPELService in the Enter New Project Name field.

  4. Click Add Project.

  5. In the Project Explorer, select JBISyncBPELService.

    The associated Project page appears.

  6. Do the following to create the folder structure for the new project:

    1. Under Folders on the Project page, enter WSDL in the Enter New Folder Name field and then click Add Folder.

    2. Repeat the previous step to add two more folders named ProxyService and BusinessService.

    3. Click Activate, enter a description of the changes, and then click Submit.

  7. Continue to the following procedure to create the necessary resources.


Creating the WSDL, Proxy Service, and Business Service Resources

  1. In the Change Center in the upper left, click Create to start a new WebLogic session.

  2. In the navigation panel on the left, click Project Explorer.

  3. Do the following to create a WSDL resource:

    1. In the Project Explorer, click JBISyncBPELService to expand the folder, and then click WSDL.

    2. In the Create Resource field, select WSDL.

      The Create a New WSDL Resource page appears.

    3. For the Resource Name, enter JBISyncWSDL.

    4. In the WSDL field, browse to and select the JBISyncBPEL.wsdl file from the Java CAPS sample project, JBISyncBPEL.

      Note: The WSDL file is located in the directory where you extracted the sample ZIP file in JBISync\JBI\JBISyncBPEL\src\.

  4. Do the following to create a new Proxy Service:

    1. In the Project Explorer, click JBISyncBPELService to expand the folder, and then click ProxyService.

    2. In the Create Resource field, select Proxy Service.

      The Create a Proxy Service page appears.

    3. For the Resource Name, enter JBISyncBPELServiceProxy.

    4. For the Service Type, select WSDL Web Service.

    5. In the field next to WSDL Web Service, browse to and select the resource file from the previous step (JBISyncWSDL).

    6. In the Select WSDL Definitions panel in the Ports category, select JBISyncBPELPort, which is the port for the JBISyncSWDL resource.

    7. Click Submit, and then click Next until you reach the Summary page.

    8. Click Save.

    9. You can optionally enable monitoring. To do so, click the JBISyncBPELServiceProxy link in the Resources panel, click the Operational Settings tab, and select the Enable Pipeline Monitoring check box for the Monitoring setting. Choose an aggregation interval and then click Update.

      The aggregation interval is the period over which aggregated statistics related to the service are computed for display on the dashboard. You can accept the default value of five minutes.

  5. Do the following to create a new Business Service:

    1. In the Project Explorer, click JBISyncBPELService to expand the folder, and then click BusinessService.

    2. In the Create Resource field, select Business Service.

      The Create a Business Service page appears.

    3. For the Resource Name, enter JBISyncBPELServiceBusiness.

    4. For the Service Type, select WSDL Web Service.

    5. In the field next to WSDL Web Service, browse to and select the JBISyncSWDL resource file from when you created the WSDL resource. Verify that the selected port is JBISyncBPELPort.

    6. Click Submit, and then click Next.

    7. Verify that the value for the Endpoint URI in the Existing URIs field is http//hostname:port/JBISyncBPELService/JBISyncPBELPort.

    8. Accept the default settings for the remaining configuration pages, and then Click Save on the Summary page.

    9. You can optionally enable monitoring. To do so, click the JBISyncBPELServiceBusiness link in the Resources panel, click the Operational Settings tab, and select the Enable Pipeline Monitoring check box for the Monitoring setting. Choose an aggregation interval and then click Update.

      The aggregation interval is the period over which aggregated statistics related to the service are computed for display on the dashboard. You can accept the default value of five minutes.

  6. Click Activate for the session.


Configuring the Proxy Service for the BPM Project

  1. In the Change Center in the upper left, click Create to start a new WebLogic session.

  2. In the Project Explorer, open the JBISyncBPELService project, and then click the ProxyService folder.

  3. In the Actions column associated with the JBISyncBPELServiceProxy proxy service, click the Edit Message Flow icon on the right side.

  4. On the Edit Message Flow window, click JBISyncBPELServiceProxy, and then select Add Route from the menu that appears.

    A new Route node, RouteNode1, is added to the flow.

  5. Click RouteNode1, and select Edit Route from the menu that appears.

  6. On the Edit State Configuration window, click Add an Action. On the menu that appears, select Communication and then select Routing.

  7. Click Service, and then select JBISyncBPELServiceBusiness from the list. Click Submit.

  8. In the Operation drop-down list, select JBISyncBPELOperation.

  9. Save your changes and then click Activate in the Change Center in the upper left.

    The proxy service is deployed to http://osb_host:osb_port/JBISyncBPELService/ProxyService/JBISyncPBELServiceProxy.


Testing the Proxy Service

  1. In the left navigation panel, click Resource Browser and then click Proxy Services.

  2. In the Actions column for JBISyncServiceProxy, click Launch Test Console.

  3. Enter values for the input message and click Execute.

    The service is invoked, and the response appears below the request.