HelloWorld Example using Mediator in SOA Suite 12c

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:

  1. Routing of Messages from service requesterA�to a service provider based on SOAP message.
  2. Filter the message flow based on routing rules.
  3. 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.

  1. Go to File >A�New >A�ApplicationHelloWorld_Mediator_1
  2. Select SOA Application option under in General > ApplicationsHelloWorld_Mediator_2
  3. Enter application name a�?XXTestAppa�� and select directoryHelloWorld_Mediator_3
  4. Click on Next and enter project name a�?HelloWorldMedPrja��HelloWorld_Mediator_4
  5. Select Composite with Mediator and give a proper composite nameHelloWorld_Mediator_5
  6. Click on FinishHelloWorld_Mediator_6
  7. Create Mediator window will open and select template as a�?Synchronous Interfacea��.HelloWorld_Mediator_7
  8. Let the input and output as default value and selectA�the checkboxA�a�?Exposed as a SOAP Servicea��.HelloWorld_Mediator_8
  9. Click on OK. The composite will look like the below screenshot.HelloWorld_Mediator_9
  10. Double click on HelloWorldMediator in a�?Componentsa�� section and .mplan file will open.HelloWorld_Mediator_10
  11. Click on the green plus icon HelloWorld_Mediator_11A�in the routing rule section,A�select a�?Target Typea�� as a�?Echo Replya��. Target type is response type to the service requestor.HelloWorld_Mediator_12
  12. Now the mapping (i.e XSLT mapping) has to be done between the request input and response output.HelloWorld_Mediator_13
  13. Click on the Transformation MapA�iconHelloWorld_Mediator_14
  14. Click on green plus iconA�to create XSLT Mapping.HelloWorld_Mediator_15
  15. Enter aA�name to the Mapper FileA�and click on OK.HelloWorld_Mediator_16
  16. .xsl file will be created.HelloWorld_Mediator_17
  17. .xsl file will look like this.HelloWorld_Mediator_18
  18. Drag and DropA�a�?concata�� function under String Functions and drag and drop a a�?concata�� function from component palate in the dotted area.HelloWorld_Mediator_19
  19. Double click on concat function to open the function and select proper parameters.HelloWorld_Mediator_20
  20. Click on OK and transformation will lookA�like this.HelloWorld_Mediator_21
  21. Now deploy the project. Right click on project, select a�?Deploya�� and then project name.HelloWorld_Mediator_22
  22. Select a�?Deploy to Application Servera��HelloWorld_Mediator_23
  23. Click on NEXT and give version id of the project. Select the checkbox ‘Overwrite any existing composites with the same revision ID’HelloWorld_Mediator_24
  24. If you have configured any standalone application server then you can select that server, but here I have Intergrated WeblogicServer configured, so as selected.HelloWorld_Mediator_25
  25. Click on NEXT and select partition here.HelloWorld_Mediator_26
  26. Click on NEXT and then FINISH.HelloWorld_Mediator_27
  27. Open Enterprise Manager Console for testing the project. (http://localhost:7101/em)HelloWorld_Mediator_28
  28. Go to SOA -> soa-infra (default server) -> select HelloworldMedprjHelloWorld_Mediator_29
  29. Click on TESTHelloWorld_Mediator_30
  30. Enter any value as input (request).HelloWorld_Mediator_31
  31. Now check the output (response).HelloWorld_Mediator_32

So, Mediator takes the input messageA�through XML based SOAP message and echoes the output.

Leave a Reply

Your email address will not be published. Required fields are marked *

Show my latest post here