Monday, December 23, 2019

Oracle SOA Mediator Sample Example

Oracle SOA Mediator
Mediator is one of the service component of the Oracle SOA Suite, there are four main functionality of Mediator
Routing : Mediator route incoming payload to the external service based on routing rule
Validate: Mediator performs XSD schema validation , it describes the structure of xml payload
Filter: Mediator defines a filter expression that specifies the service to be invoked if the payload satisfy filter condition
Transform: Mediator performs XSLT transformation , it transforms data suitable for the target                                                                                                                                                                                                                                                                    In this Demo we will be creating a composite application that routs the incoming payload to the BPEL process based on filter expression
Step 1: Click File –> new –> project –> SOA Project 
Click OK                                                                                                                                                                     Step 2: Enter the project name and click next
 Click Finish                                                                                                                                                                  Step 3: Create a Schema for input and output 
Step 4: Expose a SOAP service, drag a Soap from component panel and drop it in exposed service 
Name it as ProductDeliver, in WSDL URL click on Generate WSDL from schema as shown above 

In Interface Type choose Synchronous Interface  and click on + sign at input and name it as Request  , browse for input schema element
Choose the input element and click OK,Do the same for output click on + sign at output and name it as Response, browse for output schema element and click OK.

 Now u have exposed a SOAP Service                                                                                                                    Step 5: Drag a mediator component from component panel and drop it in Components 
 and click OK  

Now connect SOAP service with mediator
Step 6:Drag a BPEL process from component panel and drop it in components, name it as DLF and in Template choose Synchronous BPEL Process
In input click browse and select input schema element, Click OK
 In output click browse and select output schema element, Click OK
And uncheck Expose as a SOAP Service and click OK Now that u have create a BPEL Process (DLF), Follow same steps to create two more BPEL name it as Emirates and FedEx
Now connect this three BPEL to the mediator
Double click on mediator, u will find three section pointing to DLF, Emirates and FedEx BPEL
In DLF section click on filter to specifies routing rule
In routing rule we are going to compare payload element i.e. deliveryLocation  with India,if  true it will route to DLF BPEL
Click OK

Now assign payload to the input of DLF BPEL by click Assign value in mediator
After mapping payload with input of DLF BPEL
Click OK
Now that u have mapped input to DLF BPEL, u should get the out from DLF BPEL and mapped it to SOAP response
In Synchronous reply click on Assign value
Map the out of DLF BPEL to the SOAP response, Click OK
Now that u have done with DLF BPEL, do the same for Emirates and FedEx
BPEL and assign value for request and response
If deliveryLocation  is Dubai,it will route to Emirates BPEL else if deliveryLocation  is USA,it will route to FedEX BPEL

Step 7: Click on DLF BPEL , drag  assign from components panel and place it in BPEL
Double click on assign and concat product name with courier name as shown below
Do the same for Emirates and FedEx BPEL
Save all the changes and deploy the application
Step 8: Test the Application
1)
Request
Response
2)
Request
Response
3)
Request
Response






No comments:

Post a Comment