2 Replies Latest reply: Sep 14, 2009 11:47 AM by 547026 RSS

    How do I extract the name of the incoming file from the Header?ta

    Lucas Jellema
      Hi all,

      I am using 11g TP4:
      I have an File Adapter Service that reads a file. In the Routing Service I want to include the name of the file that was read in the message passed onwards to the target service.

      Previously we used an expression like
      <xsl:variable name="INFILENAME"
      select="ehdr:getRequestHeader('/fhdr:InboundFileHeaderType/fhdr:fileName','fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/>

      to set the $INFILENAME variable to the name of the file.

      This does not seem to work anymore. I notice a new namespace has appeared:
      xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.GetRequestHeaderExtnFunction"

      is this namespace the origin for a new function that replaces getRequestHeader? Is it still getRequestHeader? What then is the correct syntax - as I am getting XPath errors with either ehdr or mhdr. Is there any documentation on accessing the contents of the header?

      Thanks for any help you can provide.

      Lucas
        • 1. Re: How do I extract the name of the incoming file from the Header?ta
          Lucas Jellema
          Hi Lucas (says Lucas),

          After a little digging and trying out things I have found the solution.

          The Advanced Components palette available in the Mapping Editor has a section Mediator Functions. The getProperty() function shown there can be used to extract header properties. The property I am after is called jca.file.FileName, and can be assigned in the XSLT document like this:

          <ns2:filename>
          <xsl:value-of select="mhdr:getProperty('in.property.jca.file.FileName')"/>
          </ns2:filename>

          Note that the Assign Values dialog that is available in the Mediator editor has a long list of many names of properties that are available, including jca.file.Directory and jca.file.Size as well as many properties for the AQ, BPEL and EBS adapters.

          hope this helps any one besides myself.

          bye for now,

          Lucas
          • 2. Re: How do I extract the name of the incoming file from the Header?ta
            547026
            hi lucas,

            Thanks a lot ... it was very helpful ...
            btw the assign values thing .. doesnt seem to work in case of properties .. couldnt figure it out.

            ajith