Saturday, 14 January 2017

HelloWord OSB Application

Hi,

Today we will work on one of the very basic 'HelloWord OSB Application'.

Before we proceed for the tutorial, you must install JDeveloper 12c as a pre-requisite on your system.

For download of JDeveloper 12c, refer to the below link:

http://www.oracle.com/technetwork/developer-tools/jdev/downloads/index.html

Also, for installation and certification matrix of JDeveloper 12c, refer to the links provided below:

Certification Matrix: http://www.oracle.com/technetwork/developer-tools/jdev/documentation/121300-cert-2164864.html

Installation Steps: https://docs.oracle.com/middleware/1213/jdev/install/toc.htm

Once JDeveloper 12c is installed, we can begin with the steps for creating  'HelloWord OSB Application'.


Steps for HelloWord OSB Application

Step-1: Creating Service Bus Application with Service Bus Project.

Open JDeveloper 12c and click on 'NewApplication' in the Application Window pane.


From New Gallery Wizard within Categories pane goto: 

General->Applications->Service Bus Application with Service Bus Project


Enter Application name as 'HelloWordSBApp'.


Enter Project name as 'HelloWordSBProject'.


Click Finish.


HelloWordSBApp would be open in Application Navigator with Default configuration and Folder hierarchy.


Step-2: Create Folder hierarchy for the HelloWordSBProject.

Now, we need to create certain folders within 'Service Bus Sources' to properly manage the project resources.
  1. Services->Business
  2. Services->Proxy
  3. Pipelines
  4. Schemas
  5. WSDLs
  6. XSLTs
Right click on HelloWordSBProject and navigate to: New->Folder


Enter Folder name as Services and click OK.


Again, right click on Services folder and create two nested folders named as Business and Proxy in a similar fashion.



Similarly, create folders for Pipelines, Schemas, WSDLs and XSLTs within 'Service Bus Resource' folder.

Step-3: Create HelloWord.xsd schema file within Schemas Folder.

Right click on Schemas folder and navigate to: New->XML Schema


Enter file name as 'HelloWord.xsd' and click OK.


Create xsd as given in the below image:


Also, find below the source code of the 'HelloWord.xsd' file.


Step-4: Create SOA WSDL Document.

Now, right click on WSDLs folder and navigate to: New->SOA WSDL Document


Enter below fields in Create WSDL wizard:
  • File Name: HelloWord.wsdl
  • Binding: helloWord_bind
  • Port Type: helloWord_ptt
  • Operation: helloWord
  • Interface Type: Synchronous Interface 

Click on the plus icon of Input Parameter field and Enter Part Name as helloWordPart.


Now, browse for schema file using Magnifying glass button against the URL field and select HelloWordRequest element and click OK.


Click OK again.


Similarly, enter for Output and Fault field parameters. At last, Create WSDL wizard will look like the image given below:


Finally, HelloWord.wsdl will look somewhat like below image:


Step-5: Click to open servicebus.sboverview file (HelloWordSBProject Composite). 

Right click on Proxy Services lane and navigate to: Insert Transports->HTTP


Enter Service Name as HelloWordPS  and click on Magnifying glass to browse location for the file in Location field of the Create Proxy Service wizard.


Select Proxy from the folder hierarchy and then click Next.


Now, select Service Type as WSDL-based service and click on Browse WSDLs button on right side of the WSDL field.


Select HelloWord.wsdl from the Application and click OK.


Click Next.


Click Finish.


Finally, our servicebus.sboverview file (HelloWordSBProject Composite) will look like the below image:


Now, right click on HelloWordPSPipeline.pipeline and navigate to: Refactor->Move


Browse for Pipelines as the destination directory and click OK.


Step-6: Open HelloWordPSPipeline.pipeline file from the Pipelines folder.


Drag and drop Pipeline Pair Nodes component onto HelloWordPSPipeline.pipeline


Drag and drop Replace Message Processing Component into the Stage1 of Response Pipeline.


Enter the below fields as:
Location: Body
Provide Expression as "./exam:HelloWordRequest/exam:input"
Value: fn:concat('Hello', ' ', $body/exam:HelloWordRequest/exam:input)
Replace Option: Replace node contents


Click to save all. Finally, goto Build->Clean All 



Goto Build->Make All



Step-7: Testing HelloWord service.

Right click on HelloWordPS in Proxy Services Lane of the servicebus.sboverview file (HelloWordSBProject Composite) and click on Run.


Enter payload input and click on Execute button.


Cross check Request and Response Document to verify.



That's All Amigos, Cheer up :-)



No comments:

Post a Comment