Java CAPS Tip : From Java CAPS 5.1.x to Java CAPS 6 and Open ESB - Reuse or Rewrite

With the release of Sun Java CAPS 6 we now have a number of options on how we run traditional, build or migrate applications. This blog will take part of the forthcoming Java CAPS 6 Reference Architecture and show how you can write a number of the LDAP components using a Java CAPS Repository based application (this is essentially a Java CAPS 5.1.x application), Java CAPS BPEL Module / JBIBridge and pure Open ESB components.

Resources
Simple Application Design

All three of the implementations will be based on the following Simple CRUD implementation for mSOA type Services. The external interface provided by the applications will be WSDL and as such can be tested by any Web Service Testing tool and I will be using the NetBeans SoapUI plug-in. The following Java CAPS 6 BPEL process defines the Services provided within the solution.

Java CAPS 6 CRUD BPEL

As you can see from the above image the system simply presents the Web Service and passes the information directly to Java to perform the bulk of the work. To provide simple interfaces the WSDL and Java interfaces share common XSD definition and hence all mappings are simple. In addition because (for the JBIBridge Example) the Java CAPS 6 JCDs use first class XSD for inbound and outbound definitions they can be simply presented to the BPEL Module.

Java CAPS 6 Repository Application

You can consider this to be a Java CAPS 5.1.x migrated Application which can be done by simply exporting from Java CAPS 5.1 and then importing into your Java CAPS 6 Repository. I will not go into much detail on building the Java CAPS Repository version of this Application because I would expect the reader to have experience of the Java CAPS 5.1.x environment. Instead I will describe what will be useful for the later part of this entry and thus focus on the interface and JCDs.

In the classic Java CAPS environment you follow the steps below:
  1. Create a new Java CAPS Repository Based Application
  2. Import the ServiceManager.wsdl
  3. Create a New Java Collaboration - jcdServiceList
    1. Input ServiceManager_ListService (this complex type is defined within the XSD imported with the WSDL)
    2. Output ServiceManager_ListServiceResponse
    3. Additional LDAP eWay
  4. Write The appropriate JCD Code.

    You can check the code in the Supplied Java CAPS Repository project but I do not intend discussing it here. What we have now created is a JCD that can be used within an eInsight Business Process (See above).

  5. Repeat above for Create / Update / Delete.
  6. Create a new eInsight Business Process and drop an Event Based Decision onto the Canvas and create a branch for each of the CRUD Web Services (See above).
  7. Connect the components as below and then build and deploy.
Java CAPS 6 Repository Connectivity Map

Note : When creating the Deployment Profile based on the Environment within the download all Service Manager connections should be dragged to the wssServiceManager. Java CAPS will then identify at runtime which Web Service is being called based on the URL.

As with Java CAPS 5.1.x the Web Services are available on the Application Servers HTTP port and can be tested.

Java CAPS 6 JBIBridge Repository Application

I we assume that we already have a Java CAPS Repository application or we have imported a 5.1.x Application we may want to access the components (JCDs) directly without having to call them via Web Services or existing code. Lets say we need to access the Service Manager JCDs directly within a Java CAPS 6 BPEL 2 (i.e. Open ESB Style) Project. This can be achieved using the Java CAPS 6 JBIBridge functionality allowing the simple reuse of existing code. Their are some limitations because the components to be re-used need to be based on First Class XSDs but in general this should not be a problem. The following example will produce the same Web Service functionality seen above but this time the Web Services will be built using the new Java CAPS 6 interfaces linking to the Repository Based JCDs.

Repository Project

To prepare the components to be used within the new style BPEL environment we will need to execute the following tasks within the Java CAPS 6 Repository Project.
  1. Create a new Connectivity Map containing all the JCDs to be bridged (See Below).
  2. Instead of linking them to a Web Service external you can drag the JBIBridge component onto the canvas and link the JCDs inputs to this.
  3. Select the auto link to link the outputs.
  4. Add a JBIBridge to you environment and create a Deployment profile. You will not need to build this now and it will never be deployed using the Repository Project / components.
JBIBridge Connectivity Map

New Style Project

To use the JBIBridge components within a new style BPEL we will need first need to generate the appropriate connection WSDL that can then be used within the BPEL Module this can be done as follows.
  1. Create a Composite Application (New CAPS->ESB-Composite Application)
  2. Right-Click and add a CAPS Module. This will open a dialog allowing you to browse the CAPS Repository for Deployment Profile.
  3. Select your Deployment Profile and Import ears on clean (this will allow you to regenerate wsdl and import the ears when you choose to clean the project).
  4. Save and the select Clean & Build on the Composite Application to Generate the CAPS JBIBridge WSDLs. You will notice that a WSDL will be created for each of the Components within the Connectivity Map / Deployment Profile
Add CAPS ModuleGenerated WSDL
 
Now that we have created the JBIBridge WSDL files they can be used within a BPEL Module in the normal way. The following steps can be used to create the BPEL Process below:
  1. Create a new BPEL Module Project
  2. Add the ServiceManager.wsdl and its associated, imported, xsd files.
  3. Create a new BPEL Module and drag the ServiceManager.wsdl onto the inbound side.
  4. Drag the appropriate wsdl files, those created for the JBIBridge, from the Composite Application and drop them onto the outbound side.
  5. The process can then be wired up as below.
  6. Once the BPEL Module has been created it should be added to the Composite Application containing the JBIBridge components.
  7. Clean and Build the Composite Application and then Deploy to the Application Server.

Open ESB BPEL Module

You do not need to deploy the Java CAPS 6 Repository project separately because it is included within the Composite Application and in fact you need to make sure you do not have the  Repository version deployed.  It can now be tested using the in-built Composite Application testing functionality.

Although this example simply built the same external Web Services you should be able to see how simple it is to reuse existing Java CAPS Repository components within the new project types.

Open ESB Application

To build this process using the Open ESB / Java CAPS 6 BPEL 2 process only we will need the LDAP BC. Once installed we will create a simple BPEL Module and within it a WSDL that matches our LDAP Structure.
  1. Create a New BPEL Project
  2. Import the ServiceManager.wsdl and its associated xsd files
  3. Right-click Project New->Other->SOA->WSDL from LDAP Server
    1. Name : ServiceCRUD
    2. Next
    3. Root DN : dc=msoa,dc=sierra,dc=sun,dc=com
    4. LDAP Server : ldap://dseehost:1389
    5. In advanced add the cn=Directory Manager and password
      LDAP Connection
    6. Next
    7. Search Tab
      1. Search Filter to the msoService Object and copy across whichever fields you would like to search on.
      2. Result filter select all
        Search Tab
    8. Add Tab
      1. Select msoaService as the Object Class
      2. Select all attruibutes
        Add Tab
    9. Update Tab
      1. Select the Update Filter Class as msoaServe and the filter attribute as msoaSvcId
      2. Set the update set to all attributes apart from the msoaSvcId
        Update Tab
    10. Delete Tab
      1. Select msoaService for the remove filter class
      2. select msoaSvcId as the filter attribite
        Delete Tab
    11. Finish
    12. This will create a ServviceCRUD.wsdl and a number of associated xsd files.
  4. Right-Click on the project New->BPEL Process and name it ServiceManager.bpel
  5. The Process should then be wired up as below. The precise mapping in each of the assigns can be seen by installing the module export (MSOAServiceBpelModule.zip).
    BPEL
  6. Create a Composite Application and include the module.
  7. Undeploy the previously create modules and then Clean & Build / Deploy the Composit Application.
Again this example is intended to be simple but shows how we can take a Java CAPS process and write it within the Open ESB / Java CAPS 6 framework.


Resources


Comments:

This information is awesome!!! Thanks very much for this detail.

Posted by Samir P on February 24, 2009 at 05:58 PM GMT #

Post a Comment:
Comments are closed for this entry.
About

As a member of the Oracle A-Team we specialise in enabling and supporting the Oracle Fusion Middleware communities.

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today