Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

Prasad Bhogle
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

File And FTP Adapters

In this article we will discuss various aspects and features of File Adapers and FTP Adapters. These adapters are mostly used in projects which deal with data transfer activities like interfacing with legacy systems.

File and FTP Adapters

 

These are fairly simple to understand. These can handle various files viz. XML,Delimited, Fixed positional, Binary data etc. File Adapters can perform read and write operation. For inbound/read transactions we need to setup polling frequency for a given adapter instance. One adapter can perform one operation hence if we need to perform both reading and writing the file then we need to create two adapters in a BPEL/ESB project.
Lets develop one example using multiple file adapters viz.
1.ReadEmpDataFile - This adapter will read csv data files containing employee and dept information in one file
2.WriteEmpFile- This adapter will write employee data file from employee portion of input data file
3.WriteDeptFile - This adapter will write dept data file from dept portion of input data file
ReadEmpDataFile Adapter will need Receive Activity which will accept input from ReadEmpdataFile Adapter while Write Adapters will need Invoke Service.
Drag the file adapter service from Component pallet to Services Section of BPEL Project Designer.
As discussed we can perform one operation at a time using file adapter, so select Read File Operation
Specify the directory path for reading and archiving files. Make sure this path exists on the machine where SOA Suite is installed.
Specify the Name Patterns for files being read.
Since this is Read File Operation, we will have to specify the polling frequency.
This step defines the structure of the messages being read. We can specify the pre-existing XSD (XML Schema Definition) or DTD (Document Type Definition) or Define the schema based on CSV files by clicking Define Schema for Native Format
After Clicking Define schema following screen appears which creates XSD representation of native formats like CSV, TXT etc.
We can select various file types like Delimited, Fixed length, DTD
em_dept.csv contains data in following format
"EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO","DEPTNO_1","DNAME","LOC"
"7782","CLARK","MANAGER","7839","09-JUN-81","2450","","10","10","ACCOUNTING","NEW YORK"
With this Adapter Configuration is complete and it will automatically create a partner link.
Follow the similar steps mentioned above to create two more file adapters for write operation viz, WriteEmpFile and WriteDeptFile
For WriteEmpFile adapter use employee CSV file in following format
"EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO"
"7369","SMITH","CLERK","7902","17-DEC-80","800","","20"
For WriteDeptFile use Department CSV file in following format
"DEPTNO","DNAME","LOC"
"10","ACCOUNTING","NEW YORK"
Create One Receive Activity for ReadEmpDataFile and two Invoke Activity for two write operation adapters. Two Invoke Variables need to get values from Receive variables. To do this we will need one Assign Activity. (We will discuss about individual Processes in next articles). Final BPEL Process will look like
In Assign_1 activity we can assign individual data elements from Receive Activity XML to individual Emp and Dept XML variables
Rebuild the Project and Deploy it on local SOA Suite.
FTP Adapters
FTP Adapters work in the similar manner like File Adapter. While using FTP Adapter One needs to take care the FTP Adapters are setup on Application Server. Separate Adapter is needed for each machine to which FTP operation is used. Developer has to make sure that JNDI Name used in BPEL Project of JDeveloper exists on Oracle Application Server
FTP Adapters have Get File and Put File Operations and it supports both ASCII and Binary Files
Remaining steps of FTP Adapter are same as File Adapter.
File Paths used for Both FILE and FTP adapters can be physical path or logical path. We have used physical path in above example. Logically path can be specified as follows:

Summary:

File and FTP Adapter services are similar in the way they get used in JDeveloper BPEL/ESB designer. The only difference we can say if there must be one FTP Adapter setup for each machine to/from which files will be transferred. The JNDI Names used for FTP Adapters in BPEL Process designer must be present on Application Server.
Next article onwards, we will be discussing various Process Activities and other features branching/loouping etc related to BPEL.

Prasad Bhogle

Comments   

0 #1 vilasam 2008-09-08 14:53
Your articles are really useful for the learners. I really appreciate your work. I would like to ask a question on how get the source code of a bpel process from the server to open in the Jdeveloper. I am trying to open a bpel process that was developed and deployed by somebody else. I am not sure where to find the source code on sever. please help.
Quote
0 #2 Srikant 2008-09-09 10:03
In Jdeveloper you have a option (source) tab besides the designer tab, where u can see the source code....
Quote
0 #3 Eric Elzinga 2008-09-09 15:56
Hi Vilasam,

If you go to /bpel/domains/d efault/tmp
and do ls -al you will see all the deployed bpel processes (extracted from the bpel jar).
In here you will find all the wsdl's and the bpel-file
Quote
0 #4 Dhaval Rathod 2008-09-10 02:01
Hi,
I am trying to use FTP adapter with logical path trying to do archive the file. But it is not working for me. Can you please tell me how to do the same for logical path.

Is it any specific setup required on BPEL process? Please let me know the same.

Thanks.

Regards,
Dhava l Rathod
Quote
0 #5 vilasam 2008-09-10 10:10
Eric and Srikant,

Thanks for the reply.

Eric - I found the files. Thanks for the help.
Quote
0 #6 Divyakolu 2008-09-23 12:50
Hi Prasad,

Your above articles are really useful for the learners and same way I have some requirement to transfer files from one location to another location.

Can you please provide me some steps like your previous article using File and FTP adapters.

Rega rds
Venkat
Quote
0 #7 HANSY 2008-11-24 15:13
Hi,
I have one XSD file coming from BPEL process , I want to read this XSD file and display it on UI using Oralce JSF.
Another page, that can write to this XSD File using the mean of Orcl JSF form.

Thax
Quote
0 #8 Sharmila Ghosh 2009-02-12 07:17
Please let me know how to create JNDI location for FTP Adapters.......
Quote
0 #9 ArvindMishra 2009-12-21 11:34
Hi, I am trying to read the binnary file and store in a variable to convert in base64 string. Any help would be greatly appreciated.

T hanks
Arvind
Quote
0 #10 GoBigBoy 2010-01-12 08:19
Hi
very useful article, but one question:
is it possible to have the ftp adapter archive processed files on the ftp server.
I use ftp adapter to get files from ftp server, but when processed I want them archived on ftp server, in different location.
That would of course mean a put to the ftp server.
Quote
0 #11 SumanJoshi 2011-09-09 08:14
Hi,
The article is very useful. I created BPEL process with one File Adapter to read data from file and one File Adapter to write data to other file.
The process has one Receive and one Invoke activities. As we are doing file operation we don need any iput variable. I am able to deploy process. But how to Test ? Test tab on UI (server) is disabled.

Than ks
Suman
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  May 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
    1  2  3  4  5
  6  7  8  9101112
13141516171819
20212223242526
2728293031  

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner