Author Owen Wang SR. Engineer
Case Scenario:
If one of the DB record is updated, insert or delete in DB table, applications need to capture these changes and send request message to notify the back end application.
Most of people know how to listen on a database table in the BPEL, because BPEL has a good DB adapter wizard component to guide you step by step for a DB table read, but how to implement this functionality in the oracle service bus?
Here I want to introduce a way to figure it out. In this example, we still need to use BPEL to help us to set up the DB table listener for the OSB proxy service.
Here are the general steps as below:
1. Drag a DB adapter in the Exposed Services of the BPEL application to read message from Database.
2. Follow the wizard guide step to step to finish the configuration. After this step, you will get a WSDL file, a JCA file and a *-or-mappings.xml file. Let’s named them Bpel.wsdl, DBRead.jca and DBRead-or-mappings.xml.
3. Create a JCA Binding Resource in the oracle service bus, then copy the content of DBRead.jca to the new JCA Binding resource, also you need to associate the Bpel.wsdl and DBRead-or-mappings.xml files with JCA Binding.
4. After JCA Binding is finished, click the “Generate WSDL and Service from this JCA Binding resource” button in the right of the JCA Binding file. (This step is important. You need to use the wsdl and service generated by OSB itself.)
5. After step 4, you will get a proxy service and another wsdl file in the oracle service bus, let’s named them DBReader.proxy and db_OSB_reader.wsdl file.
6. Please pay attention on the db_OSB_reader.wsdl, it will import the Bpel.wsdl structure and db_OSB_reader. WSDL will be used by DBReader.proxy service.
7. Configure JCA protocol , endpoint URL etc settings in the DBReader.proxy
8. Activate the changes in the oracle service bus.
PS: There is an XSD file associates with the Bpel.wsdl file, this XSD file is the service schema element file which is used to mapping the Database table fields.
You can also create the artificats in Jdeveloper and after that use the “import resources from url” in Eclipse to import the jca needed artificats. Point to the jca file and the import will import the jca file + wsdl + xsd for you. Now you can just rightmouseclick on it and generate service.