Wednesday 26 September 2018

Oracle SOA Mediator

Oracle SOA Mediator

Mediator is one of the service component of the Oracle SOA Suite, there are four main functionality of Mediator
  1. Routing : Mediator route incoming payload to the external service based on routing rule
  2. Validate: Mediator performs XSD schema validation , it describes the structure of xml payload
  3. Filter: Mediator defines a filter expression that specifies the service to be invoked if the payload satisfy filter condition
  4. 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                                                                                                                                       OracleSOAMediator1                                                                                                                                                                                                                              Click OK                                                                                                                                                                                                     Step 2: Enter the project name and click nextOracleSOAMediator2                                                                                                                                                                                                                                         Click Finish                                                                                                                                                                                                     Step 3: Create a Schema for input and output                                                                                                                                                                                                                                            OracleSOAMediator3                                                                           Step 4: Expose a SOAP service, drag a Soap from component panel and drop it in exposed service OracleSOAMediator4                                                                                                                                                                                                                                                                            Name it as ProductDeliver, in WSDL URL click on Generate WSDL from schema as shown aboveOracleSOAMediator5                                                                                                                                                                                                                                                                                   In Interface Type choose Synchronous Interface  and click on + sign at input and name it as Request  , browse for input schema element
    OracleSOAMediator6                                                                                                                                                                                                                                                                                                                      Choose the input element and click OKDo the same for output click on + sign at output and name it as Response, browse for output schema element and click ok OracleSOAMediator7                                                                                                                                                                                                                                                                                                                   Now u have exposed a SOAP Service                                                                                                                                            Step 5: Drag a mediator component from component panel and drop it in Components                                                                                                                                                                                                                                                OracleSOAMediator8                                                                                                                                                                                                                                                                                                 and click OK                                                                                                                                                                            OracleSOAMediator9                                                                                                                                                                                                                               Now connect SOAP service with mediatorStep 6:Drag a BPEL process from component panel and drop it in components, name it as DLF and in Template choose Synchronous BPEL ProcessOracleSOAMediator10                                                          In input click browse and select input schema element, Click OK
    OracleSOAMediator11                                                                                               In output click browse and select output schema element, Click OK
    OracleSOAMediator12                                                                                                 And uncheck Expose as a SOAP Service and click OKNow that u have create a BPEL Process (DLF), Follow same steps to create two more BPEL name it as Emirates and FedExOracleSOAMediator13Now connect this three BPEL to the mediatorOracleSOAMediator14
Double click on mediator, u will find three section pointing to DLF, Emirates and FedEx BPEL
OracleSOAMediator15
In DLF section click on filter to specifies routing rule
OracleSOAMediator16
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
OracleSOAMediator17
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
OracleSOAMediator18
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
OracleSOAMediator19
If deliveryLocation  is Dubai,it will route to Emirates BPEL else if deliveryLocation  is USA,it will route to FedEX BPEL
Step 6: Click on DLF BPEL , drag  assign from components panel and place it in BPELOracleSOAMediator20
Double click on assign and concat product name with courier name as shown below
OracleSOAMediator21
Do the same for Emirates and FedEx BPEL
OracleSOAMediator22
OracleSOAMediator23
Save all the changes and deploy the application
Step 7: Test the Application
1)
Request
OracleSOAMediator24
Response
OracleSOAMediator25
2)
Request
OracleSOAMediator26
Response
OracleSOAMediator27
3)
Request
OracleSOAMediator28
Response
OracleSOAMediator29

No comments:

Post a Comment