Mediator example….
My project aim is to read data file(example txt) from one file directory and put in to another file directory…
For reading txt file( Incoming file)I am creating one directory
Ex: D:\krishna
My data file is student.txt
Ur composite will look like this
Take one file adapter at exposed service side…..
You need to add directory for Incoming files…
Click on Browse for add directory…
Click on native format builder…
To convert txt file to xsd
For file name click on browse..
Finally click on finish…
Make a wire to file adapter to mediator like this…
For put outgoing data file into directory we will create one directory..
Like
D:/write
Take a one more file adapter at reference side,….
Now click on browse for schema file…
Make a wire to mediator to write file adapter…
Now our task is to route the data by using mediator…
Now double click on mediator…
IN filter Expression I am writing condition here…
Expand the all root nodes…
Now click on Insert into Expression
Now we need to transfer the data by using Transformation
Save all ….
Now go and deploy …
You can go and check the input directory and output directory…