Load File


The Load File filter enables you to load the contents of the specified file, and set them as message content to be processed. When the contents of the file are loaded, they can be passed to the core message pipeline for processing by the appropriate message filters. For example, the Load File filter might be used in cases where an external application drops XML files on to the file system to be validated, modified, and potentially routed on over HTTP, JMS, or simply stored to a directory where the application can access them again.

For example, this sort of protocol mediation can be useful when integrating legacy systems. Instead of making drastic changes to the legacy system by adding an HTTP engine, the API Gateway can load files from the file system, and route them on over HTTP to another back-end system. The added benefit is that messages are exposed to the full compliment of message processing filters available in the API Gateway. This ensures that only properly validated messages are routed on to the target system.


To configure the Load File filter, specify the following fields:

Name Name of the filter to be displayed in a policy. Defaults to Load File.
File Specify the path to the file that the content is loaded from (for example, c:/workspace/example_file.xml).
File contents Choose one of the following options:
  • Raw file

  • HTTP message including HTTP headers

This enables you to load the contents of a raw file, or to load archived HTTP messages from disk.
Output directory Specify the directory to write the output to at the end of processing (for example, c:/my_app/output_dir).
Finishing processing Specify the action to take when processing is complete:
  • Do nothing

  • Delete loaded file

  • Move loaded file to following directory

If you select Move loaded file to following directory, the Directory field is enabled to allow you to specify the directory that the file is moved to. The default is Do nothing.