Apps To Fusion

.......Our Journey from Apps To Fusion

 
  • Increase font size
  • Default font size
  • Decrease font size



ESB BPEL Using Oracle SOA Suite -Article III

E-mail
User Rating: / 3
PoorBest 

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.
Comments (11)add
...
written by vilasam , September 08, 2008
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.


report abuse
vote down
vote up
Votes: +0
Hello Vilasam
written by Srikant , September 09, 2008
In Jdeveloper you have a option (source) tab besides the designer tab, where u can see the source code....
report abuse
vote down
vote up
Votes: +1
...
written by Eric Elzinga , September 09, 2008
Hi Vilasam,

If you go to /bpel/domains/default/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
report abuse
vote down
vote up
Votes: +0
FTP Adapter not doing Archive
written by Dhaval Rathod , September 10, 2008
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,
Dhaval Rathod
report abuse
vote down
vote up
Votes: +3
...
written by vilasam , September 10, 2008
Eric and Srikant,

Thanks for the reply.

Eric - I found the files. Thanks for the help.
report abuse
vote down
vote up
Votes: +0
Using FTP Adapters -- I need transfer files from one location to another location
written by Divyakolu , September 23, 2008
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.

Regards
Venkat
report abuse
vote down
vote up
Votes: +2
Read Data From XSD and Display it on ADF Form
written by HANSY , November 24, 2008
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
report abuse
vote down
vote up
Votes: +0
JNDI location
written by Sharmila Ghosh , February 12, 2009
Please let me know how to create JNDI location for FTP Adapters.......
report abuse
vote down
vote up
Votes: +0
How to Read Binnary File
written by ArvindMishra , December 21, 2009
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.

Thanks
Arvind
report abuse
vote down
vote up
Votes: +0
archive processed files,
written by GoBigBoy , January 12, 2010
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.
report abuse
vote down
vote up
Votes: +1
Test File Adapter
written by SumanJoshi , September 09, 2011
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.

Thanks
Suman
report abuse
vote down
vote up
Votes: +0
Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security image
Write the displayed characters


busy
Last Updated ( Monday, 08 September 2008 17:19 )  

Search apps2fusion