Oracle SOA file adapter example part 2

Continuing from previous part Oracle SOA file adapter examples using mediator, will will now configure File Adapter to write file.

1)  Drag and drop a file adapter in External references lane. Name it as “WriteFileAdapter” click next and then again next on operation window select Write File. Click next again and on file configuration window give directory path where you want to write your file like i did and also give file naming convention.

2) Click next to move on Messages window. click browse for schema file icon and select Writefile from OutputData.xsd. click next and finish the file creation wizard.your composite will now look like as shown below.

3) Now double click on your Mediator component “RouteRequest” It will open .mplan file, click on green + icon and select static routing rule. A popup will come then click on service as we are going to call a service.

4) From preferences select write under WriteFileAdapter. Now we will create a mapping file to map input and output files. Click on transform icon and create a new mapping file as shown below.

 6) Now map firstName with fName and lastName with LName as shown below

7) Now deploy your project on SOA server by directly using JDeveloper or create an SAR file and deploy manually. I suppose you have an idea how to deploy composite on server.
Copy the below lines and create new xml file, then put this file to your file reading directory wait at least some seconds max 1 minute. Your file will get delete from read file directory and will be written in your output file directory, Please check to verify. Lets see instance on enterprise manager.
XML file to use

<?xml version=”1.0″ encoding=”UTF-8″ ?>
<!–  $Header: sampleinput.xml 18-may-2007.04:44:38 mahnaray Exp $ –>
<ReadFile xmlns=”http://TargetNamespace.com/readFile”>
   <ReadFiles>
      <FirstName>Muhammad</FirstName>
 <LastName>Nasir</LastName>
   </ReadFiles>
</ReadFile>

You can expand flow trace to check process execution. Now you can check your write file directory as shown below.

Now you have learned how to configure SOA file adapter for file read and file write. You have learned how to configure and use Oracle Mediator and how to create transformation file. Please don’t hesitate to comment if you find any problem.


Posted

in

by

Tags:

Comments

2 responses to “Oracle SOA file adapter example part 2”

  1. Unknown Avatar

    can you please post a similar example for dynamic routing

  2. Muhammad Nasir Avatar

    Sure, As soon as I get some free time I will post dynamic routing example