Oracle Service Bus transforms complex and brittle architectures into agile integration networks by connecting, virtualizing, and managing interactions between services and applications. In this post I will explain how to
create a simple web service in Oracle Service Bus 12c based on functions or stored procedures in a database.
Service Bus provides a J2EE Connector Architecture (JCA) transport that interacts with back-end Enterprise Information Systems (EIS), letting these systems participate in the Service Bus integration environment. The JCA transport provides native connectivity between Service Bus and external systems, letting those systems interact in the service bus layer and leverage the capabilities and features of Service Bus. For our purposes we will be using JCA Database Adapter, which lets Service Bus business and proxy services communicate with Oracle databases or third-party databases through JDBC.
We will expose the web service of the ADD_JOB_HISTORY
Stored Procedure in HR Schema from Oracle Service Bus 12c, we can test this by updating
job history of an employee in the HR Shema in our database from the service.
We create a New | Project from out
application perspective in Jdeveloper.
We will select Service Bus Project
We will give a project name and then
Next we drag the Database adapter on the
external services of the project and call it addJobHistory.
In the Service Connection dialog, we will select a database connection
already defined for our project.
Select the ADD_JOB_HISTORY Stored
Procedure in the HR Schema.
We will accept the defaults for the next
steps and click Finish.
The result will be an Oracle Service Bus
Business Service (.biz) created by the Database adapter.
Deployment and Testing
We can test the business service to
confirm that the service can actually execute the ADD_JOB_HISTORY Stored Procedure in the HR Schema.
Before deployment to Weblogic, we would
have created the Datasource and Connection Factory as in this blog.
The Business Service successfully
executes with no response as the Stored Procedure has no output parameter.
Next we confirm by running a select query
on our JOB_HISTORY table. The Update appears in the records.
To create a Proxy service to decouple
your database, see my previous blog. Hopefully my series of posts has assisted you getting more comfortable with Web Services through Oracle Service Bus 12c. For more samples and guides check out the Oracle Service Bus Learn More section and the SOA section on Oracle Learning Library