Wednesday, October 29, 2014

Oracle SOA: Sync Read of file in Oracle SOA using File Adapter

I was working on one of the requirement in which we need to read the file in between the Bpel process i.e. File Adapter is not triggering the bpel process but inside the bpel process file adapter is triggered to get the file.
Here in this post I am taking a small example to make you guys understand that what this option in file adapter means.


In my example I am using a two file adapters one is writing of file and other is sync read of file. Well writing file adapter I used just to create a xml file so that I don't have to create manually. In the second adapter i.e. Sync Read File adapter I am passing the name of the file that is created by write file adapter. I put the same directory for write and read i.e. "G:\Anshul\SyncRead" and for archiving "G:\Anshul\Archive\SyncRead".


  1. Create SOA Application and then SOA project.
  2. Create schema file, I have created Info.xsd.
  3. Drag n drop, File Adapter to reference lane and configure for write operation.
  4. Again drag n drop File Adapter to configure Sync Read File operation

  5. Create Bpel Process and exposed this bpel process as SOAP webservice. 
  6. After that wired all the components and you composite looks like below.
  7. Now Inside the bpel process, assign the filename to write the file and same file name to be passed to Sync Read File adapter. 
  8. Create a local variable i.e. FileNameVar and put the value concat("Info_",ora:getComponentInstanceId,".xml") this is xpath function which generates the file name like Info_10001.xml
  9. Now pass the above file name in Invoke activity of both the file adapter.
  10. Apply the Request/Response transformation to invoke variables.
  11. Save, deploy and test.
You can download the code from here : com.codeconfuse.soa.FileSyncRead

No comments:

Post a Comment