Sunday, June 1, 2008


Sometime it is required to do file input/output operations from a BPEL process. You can use file adapter to read/write files, but it’s not a wise choice always. Oracle BPEL having three XPath extension functions ora:readFile, ora:readBinaryFromFile and ora:writeBinaryFIle for file input/output operations. You can read/write files using these extension functions.

Syntax of these functions is simple and JDeveloper expression builder helps you to add the functions in your BPEL process. You can read files packaged inside BPEL process suite case or from the file system.

While accessing files from the file system using absolute path, you might get the following error:

ORABPEL-09500 XPath expression failed to execute. Error while processing xpath expression, the expression is "ora:readFile(bpws:getVariableData('inputVariable','payload','/client:TestProcessRequest/client:input'))", the reason is FOTY0001: type error. Please verify the xpath query.

The error message is wrong and deceptive. Although the error message is showing that the XPath expression is incorrect but it’s not the reason behind this fault. Reason behind this error is that the BPEL process manager is unable to access file(s) from the given path and it is showing wrong error message. It may be a bug in Oracle BPEL Process Manager.

To get rid of this issue you need to check the path of the file you want to read or write. Make sure that you are giving the correct path and the file is available at the given location (if you are reading the file). After checking and correcting the file path you need to prefix the file path with “file:”. Next step is to save, deploy and test the BPEL process.