Showing posts with label fileadaptor. Show all posts
Showing posts with label fileadaptor. Show all posts

Friday, December 12, 2008

ESB ftp adaptor missing class oracle.tip.adapter.file.outbound.FileIoInteractionSpec

If you happen to get an error in the ftp adaptor that it is unable to find the class oracle.tip.adapter.file.outbound.FileIoInteractionSpec, the most likely reason is that there is a class loading issue. To validate the issue, you can use the MBean for class loading and run the following command.

FindResource(oracle.tip.adapter.file.outbound.FileIoInteractionSpec)

If the above command indicate that the class is not found, you may run the following command to verify it it is atleast in your system.

Depends(oracle.tip.adapter.file.outbound.FileIoInteractionSpec)

If this command shows that the class in in the FTPAdaptor jar file, you may simply delete the /j2ee//connectors/FileAdapter/FileAdapter directory and restart the container. This will reimport the files in the fileadaptor directory with the right files.

Tuesday, December 2, 2008

How to: Get filename from ESB adaptor

Oracle ESB provides header functions that allows designers to access inbound and outbound header functions. The following are the functions available.

1. String getRequestHeader(String xpathExpression,String namespaceDecl)
2. void setOutboundHeader(String xpathExpression,String value, String namespaceDecl)
3. String getInboundResponseHeader(String xpathExpression,String namespaceDecl)
4. void setResponseHeader(String xpathExpression,String value, String namespaceDecl)
Where,
xpathExpression : XPath expression to get/set
value : value to be set for the xpathExpression
namespaceDecl : namespace declarations in the form ‘prefix=namespace;’


You can use the following code snippet in your transformation xslt to get the name of the file that is read by the file adaptor in ESB.

<xsl:variable name="GET_INFILENAME" select="ehdr:getRequestHeader('/fhdr:InboundFileHeaderType/fhdr:fileName',
'fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/>

Sunday, November 23, 2008

How to set the name of the file dynamically during transformation time in ESB fileAdaptor

Oracle ESB provides header functions that allows designers to access inbound and outbound header functions. The following are the functions available.

1. String getRequestHeader(String xpathExpression,String namespaceDecl)
2. void setOutboundHeader(String xpathExpression,String value, String namespaceDecl)
3. String getInboundResponseHeader(String xpathExpression,String namespaceDecl)
4. void setResponseHeader(String xpathExpression,String value, String namespaceDecl)
Where,
xpathExpression : XPath expression to get/set
value : value to be set for the xpathExpression
namespaceDecl : namespace declarations in the form ‘prefix=namespace;’


You can use the following code snippet in your transformation xslt to set the name of the file that is about to written by the ESB File adaptor. This overrides the name given in the design time.

<xsl:variable name="SET_OUTFILENAME"
select="ehdr:setOutboundHeader('/fhdr:OutboundFileHeaderType/fhdr :fileName', $GET_INFILENAME, 'fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/>


The variable GET_INFILE is the name of the input file name as referred in the previous post.
If you like an example project, you can download it from oracle site here The sample project is under HeaderSupportDemo folder.