Archive

Archive for the ‘Mediator’ Category

Oracle Mediator 11G Sample

January 12, 2011 Leave a comment

Mediator :

Mediator is a light weight component and a distributed middleware system used to integrate  dissimilar application or component.

Mediator receives the client requests and transforming the request using XSLT mapper to targeted services or references.

 

Here I have given the sample to create Mediator project in Oracle Fusion Middleware 11G.

IDE Used:

Oracle JDeveloper 11.1.1.3.0

Step by step procedure to develop mediator 11G sample.

 

1. Create SOA application and right click and select New Project :





2. Select projects on that select SOA project and click OK




3. Enter the SOA project name and click Next:





4. Select Composite with mediator and click Finish :





5. Then name the mediator and and choose Define Interface Later and Click OK.





6. Create a consumer provider contract in the format of XML Schema like given below:

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.example.org"
            targetNamespace="http://www.example.org"
            elementFormDefault="qualified">
  <xsd:element name="BalanceRequest">
    <xsd:annotation>
      <xsd:documentation>
        A sample element
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="accountNumber" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="BalanceResponse">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="accountBalance" type="xsd:double"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="BalanceFault">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="faultString" type="xsd:string"/>
        <xsd:element name="faultActor" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

7. From Mediator component drag to add new service to the consumer





8. Previous step will prompt you to create web service which is going to be exposed to consumer.


8.1. Name the service
8.2. choose the Type
8.3. Create the WSDL url from contract defined or enter the wsdl url.
8.3.1 While creating wsdl from schema ,specify the input , response and fault from BalanceBM.xsd and change the opertion name , namespace if necessary and click OK






9. Now the PortType is generated based upon the details given , then choose Transaction participation and Click OK






10. Then Drag and Drop the mediator component to create new external reference.





11. Give the details to create external reference from webservice wsdl url like shown below and select portType and Click OK





12. SCA mediator component created like this shown below.



Advertisements
Categories: Mediator, SOA Tags: , , ,