Wednesday 19 June 2013

Oracle Serive Bus: Get file name from proxy service

The following is how to get the file name of a file that is being processed by a proxy service in OSB.

1. We can get the URI via the $inbound context variable with the following XPath:
$inbound/ctx:transport/ctx:request/tp:headers/file:fileName

This results in:
<file:fileName
xmlns:file="http://www.bea.com/wli/sb/transports/file">
c:\temp\input\2635978486281_
test.xml</file:fileName>

2. To get the filename only, use the tokenize function (which returns the characters after the last "\\":
tokenize($inbound/ctx:transport/ctx:request/tp:headers/file:fileName, "\\")[last()]

No comments:

Post a Comment