Mediator is a light weight intra composite component in SOA Suite 12C. It helps in routing messages to different SOA Components. XSLT/ XQuery mapping is used in mediator between source and target value. Mediator basically performs the below tasks:
- Routing of Messages from service requesterA�to a service provider based on SOAP message.
- Filter the message flow based on routing rules.
- Transform the incoming message format according to the expectation of the service provider through XSLT/ XQuery Transformation.
Here I am going to give a simple example of Mediator. In this example, the output will be displayed the input value concatenating with Hello.
- Go to File >A�New >A�Application
- Select SOA Application option under in General > Applications
- Enter application name a�?XXTestAppa�� and select directory
- Click on Next and enter project name a�?HelloWorldMedPrja��
- Select Composite with Mediator and give a proper composite name
- Click on Finish
- Create Mediator window will open and select template as a�?Synchronous Interfacea��.
- Let the input and output as default value and selectA�the checkboxA�a�?Exposed as a SOAP Servicea��.
- Click on OK. The composite will look like the below screenshot.
- Double click on HelloWorldMediator in a�?Componentsa�� section and .mplan file will open.
- Click on the green plus icon A�in the routing rule section,A�select a�?Target Typea�� as a�?Echo Replya��. Target type is response type to the service requestor.
- Now the mapping (i.e XSLT mapping) has to be done between the request input and response output.
- Click on the Transformation MapA�icon
- Click on green plus iconA�to create XSLT Mapping.
- Enter aA�name to the Mapper FileA�and click on OK.
- .xsl file will be created.
- .xsl file will look like this.
- Drag and DropA�a�?concata�� function under String Functions and drag and drop a a�?concata�� function from component palate in the dotted area.
- Double click on concat function to open the function and select proper parameters.
- Click on OK and transformation will lookA�like this.
- Now deploy the project. Right click on project, select a�?Deploya�� and then project name.
- Select a�?Deploy to Application Servera��
- Click on NEXT and give version id of the project. Select the checkbox ‘Overwrite any existing composites with the same revision ID’
- If you have configured any standalone application server then you can select that server, but here I have Intergrated WeblogicServer configured, so as selected.
- Click on NEXT and select partition here.
- Click on NEXT and then FINISH.
- Open Enterprise Manager Console for testing the project. (http://localhost:7101/em)
- Go to SOA -> soa-infra (default server) -> select HelloworldMedprj
- Click on TEST
- Enter any value as input (request).
- Now check the output (response).
So, Mediator takes the input messageA�through XML based SOAP message and echoes the output.