In my previous example, I have discussed about the simple example of mediator(Hello World Example) where mediator was exposed as a service.
Now I am going to explain another example of mediator, where mediator service will be created from an existing WSDL and then will be exposed.
- Create a new SOA project. Right click on application -> New Gallery -> Projects -> SOA Project.
- Click on OK and enter project name.
- Click on Next and select a�?Empty Compositea��.
- Click on FINISH and empty composite will be created. Select a�?Mediatora�� from SOA Components palate and drag and drop it into the middle swim lane a�?Componentsa�� section of the composite. It will open the a�?Create Mediatora�� window. Enter a proper Mediator name and select template type as a�?Define Interface Latera��.
- Drag a SOAP service from SOA Technology palate and drop it into a�?Exposed Servicesa�� section. Enter name ‘SOAPAsService’ and select type as ‘Service’.
- Click on a�?Generate WSDL from schemaa�� cog icon.
- Below window will appear. Enter File Name and select interface type as a�?Synchronous Interfacea��.
- Now create input and output message. Click on green plus iconA�in a�?Input Parta��. Enter part name and select schema element as a�?singleStringa��.
- Create output message same like input message.Click on OK.
- WSDL is created for exposed SOAP service.
- Now again drag a SOAP service in a�?External Referencesa�� section.
- Enter service name and WSDL URL and then select port type and callback port type as per below screenshot.
- Click on OK and uncheck the a�?Maintain original directory structurea�� checkbox.
- The composite will look like the below screenshot.
- Double click on Mediator and .mplan file will open.
- Click on mapping icon in request part.
- Click on green plus icon and create a new request mapper file. Enter the file name and Click on OK.
- Now map the input parameter from source to target parameter.
- Create same mapping for reply also.
- Map the output parameter to the output of the external reference service.
- Now deploy the project. Refer my previous article on HelloWorld Mediator for deployment process.
- The project can be tested in JDeveloper itself. In your application server tab, you can find your project after deploying the project into server.
- Right click on project and select a�?Test Web Servicea��
- Below window will appear. Give input part and click on a�?Send requesta�� and it will show the output.
- This project can be tested from Enterprise Manager Console also. Follow the steps as mentioned in my previous article to test the project from EM Console.
I hope this article helps in understanding on how to create mediator service from an existing WSDL. Your comment will help me to improvise the content. Thank you.