Oracle SOA - Fault Handling in File Adapter For CSV and XML Files in SOA 11G
Oracle SOA - Fault Handling in File Adapter For CSV and XML Files in SOA 11G
Oracle SOA: Fault handling in File adapter for CSV and XML files in SOA 11G
Share
More
Next Blog
Oracle SOA
Tuesday, September 6, 2011
About Me
Fault handling in File adapter for CSV and XML files in SOA 11G
Hi All,
I will show how we can im plem ent fault handling in file adapter when it is reading (polling) CSV files, I am using 1 1 G and using its Fault
Handling Fram ework.
This is a 2 step process,
1 .) In the first step process we hav e a com posite which is polling for CSV file's, if the file is bad then it's using fault-policies to do the required fault
Yatan
Hyderabad, AP, India
handling.
2 .) The second step is creating a new com posite which will exclusiv ely catch the error details from the first process and log it (I hav e skipped the
logging portion).
Blog Archive
2011 (7)
September (1)
St ep 1.) Create fault policies in com posite which will poll for the .csv file.
This is how our com posite looks.
Share it
This is the CSV file which I hav e used to configure the file adapter.
Share this on
Facebook
Tweet this
Employee.csv file
View stats
Nam e ID Age
(NEW) Appointment
gadget >>
y atan 1 01 2 9
Amazon Con
Product Ads
y agy a 1 02 2 7
y ugansh 1 03 2 4
Gwalior Fort
This is the XSD file which got created from the nativ e form at builder of file adapter.
Em ploy ee.xsd (Created from Jdev file adapter nativ e form at builder)
This is the contents inside the .jca file which shows the configuration details of this file adapter.
I hav e wired this File adapter with a BPEL process "ReadCSVBPEL". While creating this BPEL process I hav e giv en tem plate as "Defile serv ice
later", inside the BPEL process I hav e used a receiv e activ ity to receiv e the data.
http://yatanveersingh.blogspot.in/2011/09/fault-handling-in-file-adapter-for-csv.html
1/6
5/6/2014
Oracle SOA: Fault handling in File adapter for CSV and XML files in SOA 11G
Followers
Members (5)
The m ost im portant part is Fault Handling here, if the .csv file we are polling for is a bad file, i.e. em pty file or not schem a com pliant then we
should be notified about this.
The issue with file adapter is, if the file you are polling for is bad file it will simply rejected and the instance wont get created, this is not good as no one
would ever know what happened to the files and where are they going.
I will show here fault-policies.xm l and fault-bindings.xm l
fault -bindings.xml
2 .) This is actually the details of the composite which is exclusively doing the fault handling for file adapters. I will again describe this is
detail.
Next file is fault-bindings.xm l.
fault-bindings.xml
Now inside this file there are again 2 v alue highlighted in red, where is this v alue com ing from ,
1 .) faultPolicy = "RejectedMessages", this is v alue for our fault-policy id.
2 .) ReadCSV, this is end point for the serv ice.
St ep 2.) We hav e design a new com posite which will be used for catching the faults thrown by other com posite which we hav e designed in Step 1 .
The input for this serv ice will be this ty pe,
RejectedMessages.xsd
http://yatanveersingh.blogspot.in/2011/09/fault-handling-in-file-adapter-for-csv.html
2/6
5/6/2014
Oracle SOA: Fault handling in File adapter for CSV and XML files in SOA 11G
You can skip the below 5 steps by sim ply using this file.
1 .) Create a new com posite "FileFaultHandling" and put RejectedMessages.xsd after that drop a web serv ice adapter to the exposed serv ice area
nam e it "RejectedMessageServ ice" and on the WSDL URL use "Generate WSDL from Schem a".
2 .) Configure the WSDL file use the sam e nam espace as used in RejectedMessages.xsd after that click on Add a new m essage part
http://yatanveersingh.blogspot.in/2011/09/fault-handling-in-file-adapter-for-csv.html
3/6
5/6/2014
Oracle SOA: Fault handling in File adapter for CSV and XML files in SOA 11G
4.)
5.)
6 .) Drop a new BPEL process with tem plate as "Define serv ice later", and wire the RejectedMessageServ ice web serv ice adapter with this BPEL
process.
7 .) Inside the BPEL process use a receiv e activ ity and configure it with the RejectedMessage serv ice.
8.) Deploy the serv ice and go to the EM to get its URL.
I told that I will describe in details about a URL in fault-policies.xm l
inside fault-policies.xm l.
This is the form at
form at - Absolut e WSDL|service name|port name
WSDL of the FileFaultHandling serv ice
Serv ice nam e (This is the end point of this serv ice)
portnam e (this is the port nam e of that serv ice again)
Deploy 1 st serv ice and test.
I will keep "TestCSVFile2 .csv " file at this location "C:\Files\CSVRead" and will sim ply write som e junk data inside it, exam ple aaaa, as this is not
schem a com pliant it will get rejected and will call our FileFaultHandling serv ice and will pass the data there.
http://yatanveersingh.blogspot.in/2011/09/fault-handling-in-file-adapter-for-csv.html
4/6
5/6/2014
Oracle SOA: Fault handling in File adapter for CSV and XML files in SOA 11G
Remember, this rejection message handler will not do complete fault handling, this is only going to reject empty files, files with some
junk data or incorrect data on first line.
If we were reading a XML file then the file adapter will reject any file which is not schema compliant, the XML file will be thoroughly
checked, however this is not in the case of CSV files where only empty/junk data files will be rejected, all the non schema compliant
csv files will not be rejected by file adapter,so we have to do more work for fault handling when we are dealing with CSV files.
Posted by Yatan at 11:29 PM
3 comments:
arun April 13, 2012 at 10:48 AM
Where can I find the RejectedMessages.xsd and RejectionMessage.wsdl in soa suite 11g?
Reply
Comment as:
Publish
Google Account
Preview
http://yatanveersingh.blogspot.in/2011/09/fault-handling-in-file-adapter-for-csv.html
5/6
5/6/2014
Oracle SOA: Fault handling in File adapter for CSV and XML files in SOA 11G
Home
Older Post
http://yatanveersingh.blogspot.in/2011/09/fault-handling-in-file-adapter-for-csv.html
6/6