Wednesday, August 22, 2012

In My previous post, I explained how to invoke synchronous SOA service or any other service from Oracle Service Bus over HTTP. But when we talk about specific to SOA then we have one another protocol (SOA-Direct) which we should use to invoke synchronous SOA service from Oracle Service Bus. Below are the advantages of SOA-Direct protocol.

·         Invocation of any SOA binding component services through Java remote method invocation (RMI)
·         WS-Addressing, including optional auto-generation of ReplyTo properties for asynchronous callbacks
·         Identity propagation
·         Transaction propagation
·         Attachments
·         Optimized RMI transport for invoking SOA services
·         High availability and clustering support
·         Failover and load balancing (not available for services in the Service Callback role
·         Connection and application retries on errors

In this post, we will see how to invoke synchronous SOA service from Oracle service Bus using SOA-Direct protocol. To use the SOA-Direct protocol in OSB, First we need to make changes to our SOA service. We need to change default binding to direct binding. To do that simply drags the “Direct Binding” component from component palette.  In create Direct Binding pop-up window, choose type as service and choose service wsdl file and click on ok.


OSB to SOA Using SOA Direct Modify Composite


Now wire the direct binding service reference to already existing wire so now we can invoke the service either by default binding or by direct binding. Your composite should look like below.

OSB to SOA Using SOA Direct Modified Composite


Now we will create OSB project from where we invoke above created SOA service using SOA Direct protocol. To invoke the service we need either WSDL URL of that service or WSDL file which we need to import to OSB project.

We can not access direct binding from EM console , so to access that service, open the below URL and select your service.


Copy the service endpoint which we will use in later stage.

OSB to SOA Using SOA Direct Service URL


Create a new OSB project and add required folder structure to it. Now click on resource folder and import SOA service resources to OSB by specifying the service URL which we copied in earlier step.

OSB to SOA Using SOA Direct Create OSB Project


Create a business service which invokes the synchronous SOA service. Specify the business service name, choose WSDL as service Type and browse synchronous SOA service WSDL file.

OSB to SOA Using SOA Direct Create Business service


Click on the WSDL file and choose SOA service port with version 1.2. Click on submit.

OSB to SOA Using SOA Direct Choose Port


As mentioned in the starting we use SOA-Direct protocol to invoke synchronous SOA service, so choose “soa-direct” protocol from protocol drop down list. You see that EndPoint URI already added, this is taken from synchronous SOA service WSDL file. Click on next to go over next step.

OSB to SOA Using SOA Direct Choose Protocol


Choose Synchronous client role as we call synchronous SOA service using SOA-Direct protocol.

OSB to SOA Using SOA Direct Sync Client

Accept defaults and save the business service.

Now create the proxy service which route the message to above created business service. Click on proxy folder and choose “Proxy Service” from create resource drop down. Specify the proxy service name and Choose “Business service” as service type and browse above created business service. You can also choose “WSDL” as service type if your requester structure is different.

OSB to SOA Using SOA Direct Create Proxy Service

Accept default for proxy service and save it.

OSB to SOA Using SOA Direct Complete Proxy Service


Open the message flow of the proxy service where you can see route node is added to it and inside route node message is routed to business service.

OSB to SOA Using SOA Direct  Message Flow

OSB to SOA Using SOA Direct  Message Flow Route Node


Activate the session and test the proxy service.


OSB to SOA Using SOA Direct Testing


2 comments :

  1. Hi Vivek,
    The links to your "previous post" and to "Call Asynchronous SOA service using soa-direct" are broken...
    Cheers,
    Vlad

    ReplyDelete
    Replies
    1. Thanks Vlad, I made the necessary correction.

      Vivek

      Delete