OSB to API Platform

Selection_574.jpg

As a follow-on to my previous blog entry “ICS to API Platform,” I wanted to also show how a similar thing could be done for Oracle Service Bus (OSB).

The 12c release of OSB added many new capabilities to support REST services and execute REST services.  It also has automatic conversions between JSON and XML payloads making it very easy to expose existing webservices to REST/JSON based services.  It is also easy to consume REST/JSON services and use them just as if they were webservices.

The main issue to deal with in this use-case was to get the existing services from OSB.  It does not have REST services to get details about itself.  It uses standard JMX capabilities.  I thought about deploying a JMX->REST utility, but I thought it would be great to keep this independent of another tool.  So, I wrote a few simple java classes and I use these to get the OSB service details for publication.

The single pipeline is easy to follow.  It gets a list of OSB assets.  I do a filter on assets of type REST.  I then call the API Platform services to get an existing list of APIs.  The real work happens in the CreateAPI stage.

Selection_575.jpg

In here, we do a loop over all OSB REST services and if they don’t exist in the API Platform, we make a series of service calls to API Platform to expose it.

Selection_576.jpg

Each step is very easy.  OSB automatically generates the correct JSON payload based on the XML definition.  Simple mapping makes it all work.

I defined some of the API Platform services in the binding.  It would be easy to take this sample and expose the rest of the services to include applications and other items.

All of these APIs are documented here:
http://docs-uat.us.oracle.com/cloud/latest/api-platform-cloud/APFRM/index.html
Note: This is an internal link until API Platform is officially released.

Selection_577.jpg

Once this service is deployed, it can be setup to be called periodically by the Oracle Enterprise Scheduler Service (ESS) or just have it exposed and called whenever new services are deployed.

After it runs, the new OSB REST services are active in API Platform.

Selection_580.jpg

Here is a live demo.

Here is the code: sbconfig.jar

osb2apics

1 thought on “OSB to API Platform”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s