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

1_OSB-12c_Hello_World_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

2_OSB-12c_Hello_World_New_Service_Bus_Application_with_Project

 

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

3_OSB-12c_Hello_World_New_Service_Bus_Application_name_directory

 

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

4_OSB-12c_Hello_World_New_SB_Project

 

New Service Bus project is created with required artifacts

5_OSB-12c_Hello_World_New_SB_Project_new_project_template

 

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

6_OSB-12c_Hello_World_New_SB_Project_new_HTTP_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

7_OSB-12c_Hello_World_New_SB_Project_new_HTTP_service_wizard_a

 

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

8_OSB-12c_Hello_World_New_SB_Project_new_HTTP_service_wizard_b_create_wsdl

 

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

9_OSB-12c_Hello_World_New_SB_Project_new_HTTP_service_wizard_b_create_wsdl

 

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

10_OSB-12c_Hello_World_New_SB_Project_new_HTTP_service_wizard_b_create_wsdl

 

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

Click Finish

11_OSB-12c_Hello_World_New_SB_Project_new_HTTP_service_wizard_c_create_wsdl

 

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

12_OSB-12c_Hello_World_New_SB_Project_Pipeline

 

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

Opens up “.pipeline” file in the editor

13_OSB-12c_Hello_World_New_SB_Project_Sample_Pipeline

 

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

14_OSB-12c_Hello_World_New_SB_Project_Sample_Drag_Pipeline_Pair

 

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

15_OSB-12c_Hello_World_New_SB_Project_Sample_Drag_Replace_node

 

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

Click OK

16_OSB-12c_Hello_World_New_SB_Project_Replace_node_expression_builder

 

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

Take a look at the Replace node properties

17_OSB-12c_Hello_World_New_SB_Project_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

18_OSB-12c_Hello_World_New_SB_Project_deploy_and_testing

 

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

19_OSB-12c_Hello_World_New_SB_Project_testing_console

 

Request document and Response document

20_OSB-12c_Hello_World_New_SB_Project_testing_console_result

 

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)

 

References
http://docs.oracle.com/middleware/1213/osb/develop/osb-overview-design-jdev.htm#OSBDV87879

Happy Coding !!
Happy Learning !!

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