Saturday, July 2, 2011

OSB Dev using Eclipse - Getting Started

Introduction
   I hope that you have installed OSB 11g and created domain. Now it is the time to make your hands dirty. I will explain to you how to create a basic http-http flow using eclipse. So why to wait, open your eclipse and go on!!.  


Definitions

  • Oracle Service Bus Configuration Project - After opening the eclipse create the osb configuration project which hold multiple osb projects.
  • OSB project - holds the actual application which consists of proxy services and business services.
  • Proxy Service - which holds the actual flow implementation. It can perform routing, transformation,sercurity, monitoring and reporting
  • Business Service , which acts as an abstract access layer for the end system component where we configure the interface. Proxy service calls the end system using business service. Business services can be of HTTP, JMS, MQ, File , FTP etc.
Sample Flow (HTTP-HTTP)

Open the Eclipse and create Oracle Service Bus Configuration Project


Right click on the Oracle Service Bus Configuration project and create a new Oracle Service Bus project

Give some proper name


Right click on the Oracle Service Bus project and create new proxy service.


Open the new proxy service and click on the 'Transport' section. Select the protocol as 'http' and give a proper HTTP access URI.


Click on the 'Message Flow' section on the proxy service and drag a 'pipeline pair' to the message flow.



You can see 'Request pipeline' and 'Response pipeline' inside the pipeline pair.


Drag a 'stage' into the Request pipeline. Stage is used just to group different nodes in the flow.


Now Right click on the Oracle Service Bus Project and create a new 'business service'


Open the new business service and click on 'Transport' section . Configure 'http' as protocol and add one proper end system URI. In the figure given below, it is configured as http://www.google.com. Instead please configure any tomcat stub which gives any xml as the output.


Go back to the proxy service. Drag 'Service call out' to the 'stage'. The service call out is used to initiate a request to the end system with the help of business service and get back the response.


Click on the service call out and then click on the 'Browse' button below and select the business service.



Enter the Request variable as 'body' and response variable as 'response'. You can use any name for the response variable. But for the request variable you should use 'body' as the request xml resides in the 'body' variable.



Drag a 'replace' node to the response pipeline pair and configure it. This will copy the response obtained from the downstream to the body variable so that the response will be returned to the client.



Now the application is ready and it need to be deployed. For that we have to add the server to the workspace. 


Select the appropriate server



Select the domain directory



Finish creating the server and right click on the server created and select 'Add and Remove' and add your Oracle Service Bus Configuration Project to the server.



Right click on the 'Server' and click on 'start'. After some time the server will go to the 'Running' state.


Right click on the server and click on 'publish' so that your application will be deployed .

Testing the application
    Right click on the proxy service and select 'Run As' and select 'Run on Server' . A new window will be opened and paste some xml and hit run. If there are no errors in the end system stub, you will get proper output.

Note : Make sure that your managed server is running before testing the application.



Paste one xml on the 'Payload' section and hit 'Execute'


If your stub is working properly, You can see the proper response.



Conclusion
    This topic is just intended to kick start the development. There are more things ahead. Any way you have taken the first step of OSB application development. Try to explore more in it.

Queries?

    please contact Sajeev Ramakrishnan
    @ sajurrk@gmail.com
    @ saju_rrk@yahoo.com





6 comments:

  1. Priceless basic Hello world! example for OSB newbies. Just what I needed to get on my feet and stumble onward... :-)

    ReplyDelete
  2. get an error as


    BEA-382502

    OSB Service Callout action received an error response



    404



    PipelinePairNode1
    PipelinePairNode1_request
    stage1
    request-pipeline



    ReplyDelete
  3. Hello Atan,
    Check whether the HTTP URL is present by manually posting message using either nettool or soap-ui.

    Regards,
    Sajeev

    ReplyDelete
  4. Thanks for providing information. It’s a very nice topic. We are providing online training classes
    Oracle OSB

    ReplyDelete
  5. the knowledge of oracle dev using eclipse is very important for OSB Training taking people.Thank You for sharing useful information.

    ReplyDelete