0

I have the following XML response being returned in my Oracle OIC Integration engine:

<ListFileResponse xmlns="http://xmlns.oracle.com/cloud/adapter/ftp/Listfiles_REQUEST/types">
  <ListResponse xmlns="http://xmlns.oracle.com/cloud/list/pull">
    <position>1757090194000</position>
    <ItemCount>2</ItemCount>
    <FileList>
      <File>
        <directory>/integration/in/inventory/depletion/queue</directory>
        <filename>INVADJ20250829143000.DAT</filename>
        <lastModifiedTime>1756824857000</lastModifiedTime>
        <creationTime>0</creationTime>
        <size>3121</size>
      </File>
      <File>
        <directory>/integration/in/inventory/depletion/queue</directory>
        <filename>INVADJ20250905111500.DAT</filename>
        <lastModifiedTime>1757090194000</lastModifiedTime>
        <creationTime>0</creationTime>
        <size>914</size>
      </File>
    </FileList>
  </ListResponse>
 </ListFileResponse>

I would like to subsequently use an Xpath expression to only fetch the first file found and get the lastModifiedTime value. So in this example above I would expect to output 1756824857000 from the first set returned.

I am using the following Xpath expression attempting to get just the first occurence of the tag but it errors out in my OIC when there is more than one file in the SFTP folder.

$Listfiles/ns32:ListFileResponse/ns31:ListResponse/ns31:FileList/ns31:File[1]/ns31:lastModifiedTime

Is there an expression I can use (or modify the above) to accomplish this? Thanks in advance.

6
  • What is the error that you are getting? Commented Sep 5 at 19:49
  • @MadsHansen it's very generic, all it says is "Error summary not defined". It does work perfectly fine if I have only one file in the SFTP folder for the ListFiles operation though. Commented Sep 5 at 19:54
  • There's nothing obviously wrong with the code that you've shown us. which means that the error is in the code you haven't shown us. Sorry I can't be more helpful. Commented Sep 5 at 20:11
  • I guess my question then becomes why isn't ...File[1] from the expression only fetching the first file tag and child elements? Commented Sep 5 at 20:17
  • 1
    A Guess: the issue is about $Listfiles containing more than one item. The first is used when there's only one but fails otherwise. So the problem might be outside the XPath. May be there's a way to iterate $Listfiles Commented Sep 5 at 20:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.