Oracle OSB 12c: Hello World mock service with Proxy Service

In this article, we will go through the detailed steps for creating/developing/constructing and testing demo Service Bus project using JDeveloper 12c IDE

With 12c, we no longer required to install Eclipse IDE separately (OEPE –> Oracle Enterprise Pack for Eclipse) to develop OSB modules

Instead we can develop Service Bus projects within JDeveloper IDE itself where we normally construct SOA modules including BPEL, Mediator, Business Rules and Human Task

Refer Oracle SOA 12c installation article for more details

Business case requirement:

  • This will be a mock service where end user enters name
  • And expects a response in the format of “Hello <entered_name>

As the requirement is to just return the Hello message appended with user name entered, there is no need to design Business Service or External Service

In the next article, we will improve this design by exposing a separate Business Service and then connecting link with Proxy Service

Let’s get started with designing the OSB modules in JDeveloper 12c IDE

Step 1: Open a New Application

Application Menu –> New or File Menu –> New –> Application



Step 2: Select Service Bus Tier from available categories

Service Bus Tier –> Service Bus Application with Service Bus Project –> OK

This opens up wizard for Service Bus Application



Step 3: Enter the Application Name and its directory location for the new Service Bus Application

Leave the default values for demo; otherwise we can give more specific names in accordance to naming convention followed in the project

Click Next



Step 4: Similarly, enter Project Name

We can leave the default values for demo; or else we can give some name

For example, HelloWorldSB

Click Finish



New Service Bus project is created with required artifacts



Step 5: As this OSB module is simple mock service to return hello to the entered user, we will concentrate on the exposed service side i.e.; Proxy Service

Drag HTTP component from Technology palette and drop at Proxy Services lane –> which opens up new wizard to enter necessary details for the Proxy Service



Enter Proxy Service Name: HelloWorldProxyService

Transport: http (actually, there is no other options available)

Check “Generate Pipeline” options with default pipeline name or some more conventional name in accordance with the project standards

Click Next



Step 6: Second step of wizard to create a contract –> we will create new WSDL for contract with single input for user to enter their name and single output for returning a greeting message with hello appended with the user name

Follow below steps to create a new WSDL using wizard



In the Interface Type, choose “Synchronous Interface” from two options available –> which will enable the input, output and fault elements to be entered for inputs, outputs and faults respectively

Note: Click green plus icon to add the required elements for input, output and fault (on right-top-corner)

Click OK



After entering necessary details for WSDL contract –> output will have new WSDL auto-populated in the Create Proxy Service wizard of step 2

Click Next



Keep the default value which comes populated for the Endpoint URI or else you can change as per business requirement

Click Finish



Finally there will be HTTP component on the Proxy Service lane and Pipeline component on the Pipelines/Split Joins lane



Step 7: Double-click on the pipeline component in the Pipelines/Split Joins lane

Opens up “.pipeline” file in the editor



Step 8: Drag “Pipeline Pair” from Message Flow under “Nodes” category



Step 9: Drag “Replace” node from Message Flow under “Message Processing” category



Step 10: Add “concat” function in the replace node

Click OK



Step 11: Service Bus project design is completed according to the business requirement

Take a look at the Replace node properties



Step 12: Testing the Service Bus project deploying into the IntegratedWeblogicServer

As designing the Service Bus project is complete, it’s time to deploy the project into the IntegartedWeblogicServer and test them



This will open our traditional OSB console, where we can input and execute this sample mock service. Enter necessary detail in the Request document –> Click Execute



Request document and Response document



The same can be tested through Service console (OSB console) at http://localhost:7101/sbconsole (change the port number, if you have configured something else)



Happy Coding !!
Happy Learning !!

Oracle OSB 12c: Hello World service with both Business and Proxy Service
Oracle SOA 12c: Domain creation steps