Monday, 27 April 2015

SOA - FTP Adapter

SOA File / FTP Adapters enable BPEL process to exchange the files on local or remote file systems. 

Steps to Create File Adapter


  • Drag and drop the file adapter component  to component pallet.
  • Provide the File adapter name under Service Name
  • Select Define from operation and schema (specified later) option
  • select the Operation
    • Read File
    • Write File
    • Synchronous Read file
    • List Files
  • Mention the physical or logical path in the next page
    • Mention the Archive path if the file needs to the archived after reading 
    • Select Delete file after successful retrieval option if we  need to delete the file after successful read
  • Mention the type of files which needs to be processed
  • Mention the file polling frequency 
  • Create a schema file using existing file in the message window by clicking the settings icon
  • After creating schema select finish


Difference between Read File and Synchronous Read File Operation 

Synchronous Read :  It is a synchronous operation and follow request - response paradigm.   File read is initiated by a INVOKE process.   If the file is not found then response will have null value. 
Before invoking file read , file should be present. 


Read File :  It is a waiting call and  process will be invoked by a RECEIVE process and will be polling for a file at regular interval. 


File Processing :


If we have many inbound files to process or very large files of more than 1 MB, we may need to increase the config timeout value in the transaction-manager.xml file as shown in the following example:
<transaction-timeout="30000"/>


NOTE:
  • The Oracle File and FTP Adapters can also treat file contents as an opaque object and pass the contents in their original format (without performing translation). The opaque option handles binary data such as JPGs and GIFs, whose structure cannot be captured in an XSD or data you do not want to have translated.
  • The Oracle File and FTP Adapters support polling multiple directories within a single activation. You can specify multiple directories in J-Developer as opposed to a single directory. This is applicable to both physical and logical directories.
  • The Oracle File Adapter provides support for transferring large files as attachments. To use this feature, select the Read File As Attachment check box in the JDeveloper wizard while configuring the "Read operation." This option opaquely transfers a large amount of data from one place to another as attachments. For example, you can transfer large MS Word documents, images, and PDFs without processing their content within the composite application.