Sunday, August 19, 2012

Oracle Service Bus is mainly used for routing purpose and to route information we need to invoke/call Synchronous and Asynchronous web services from Oracle Service Bus. In this post I will explain you step by step process to invoke Synchronous web service from Oracle Service Bus.

First of all we need to have Synchronous web service. For this post I created one Synchronous BPEL (Synchronous web service) that we will invoke from OSB.

Step 1: Create a new OSB project and import Synchronous web service WSDL and Schema file.

  • Go to OSB console (http://host:7001/sbconsole)
  • Click on "Create" button to start a new session. Then click on "Project Explorer" to create new project. I created a new project "CallSyncWebService" which is having three folders resources, business and proxy.


Create Session
  • In resource folder import WSDL and schema file of  Synchronous web service. Click on "resource" folder and select "Select Resource Type" as "XML Schema" and "WSDL" from "Create Resource" drop down. Then choose Schema and WSDL file paths and add it to resource folder. First Import Schema then WSDL. 
Import WSDL and schema
  • Now we have both WSDL and Schema imported to resource folder of newly created OSB project.
Import WSDL and Schema

Step 2: Create Business Service.
  • Click on "business" folder and choose "Business Service" as "Select Resource Type" from Create Resource drop down list.
  • Give it any name and choose "WSDL Web Service" as Service Type. Click on Browse button and select previously imported WSDL file.

BS Creation

  • Select port of the WSDL file and click Submit.      Business Service Creation

  • Accept default values and click on Save button. Now we are ready with Business service.

Business Service

Step 3: Create Proxy service. Proxy service will call Business Service which in turn call Synchronous  web service.
  •  Click on "proxy" folder and choose "Proxy Service" as "Select Resource Type" from Create Resource drop down list. Name your proxy service and then choose your business service that your created earlier.
Proxy Service Creation
  • Accept default values and click on save.
Proxy Service Properties

Step 4: Now we are ready for testing.But before testing we need to activate the active session. Click on "Launch Test Console" button and test proxy service and you can one new instance of Synchronous web service.


Osb to Soa Call Test


In my next Post, I explained how to call Synchronous SOA Composite using soa-direct protocol.

Call Synchronous SOA Composite From OSB using soa-direct protocol


5 comments :

  1. how I can get the WSDL url of the service which is already deployed in OSB to use it in (data control for example or even in other application ???

    ReplyDelete
    Replies
    1. Hi Ahmed,

      To know the WSDL URL of OSB proxy service you need to export the proxy service WSDL and then check the location attribute in the service tag of that WSDL.

      Thanks
      Vivek Garg

      Delete
  2. How I create the XSD Schema from my external WSDL ?

    ReplyDelete
    Replies
    1. You will not create XSD schema from your end, you will get from external system from only. Either they will provide you WSDL URL and in that WSDL itself either they have embedded schema or they may refer some external schema and that external schema path will also be there.

      Delete
  3. Hi vivek u r information is help me alot thanks alot

    ReplyDelete