In this post I will explain how to read, delete, and archive a file from any location. This post will also explain reading content of file in 12c and configuration of NXSD (Native Format Builder). This post can be applicable for SOA 11g also.
File Adapter Configuration :
Drag File Adapter to Exposed Services section :
Enter file adapter JNDI Name
File Adapter have multiple operations read, write, sync and chunked read operations. Here we are using read operation.
Enter file source and archive location. If you don't want to archive any file, uncheck the Archive check box.
Specify File name pattern to read files based on any pattern.
Set Polling frequency. Polling frequency is the interval in which adapter will read the file from the particular location.
Now we need to define an NXSD schema, to convert the file data to XML format.
Click on the icon to define schema for Native format.
We are using here a comma separated file. So choose Delimited option here.
Select sample file to generate xsd.
Schema will be generated based on input file.
Click finish. And finish the adapter configuration.
Drag a BPEL Process Under Components section. Change Bpel name and assign your input variable and click Ok.
Drag a wire from readFile adapter to BPEL process to connect it.
Deploy the composite to SOA server. Now we are ready to test our service.
Put a file into your source location.
The file will be picked up in 1 minute as our polling frequency is 1 minute.
The file should be deleted and archived in the archived folder mentioned while configuring file adapter.
File has been archived.
Now login to SOA EM console and check for the instance created
Comments
Post a Comment