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/;')"/>

No comments: