title: WSO2 ESB: How to download a file over HTTP?
body: <p>I want to download an XML file from a Web site using WSO2 ESB. Assume that the URL is static for the sake of simplicity.</p>
  
  <p>I have tried VFS both as a proxy service and an individual sequence without success, and couldn't find any relevant material on the Internet.</p>
  
  <p>Here is the sequence XML:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;sequence xmlns="http://ws.apache.org/ns/synapse" name="download"&gt;
     &lt;in&gt;
        &lt;log level="headers"&gt;
           &lt;property name="?" value="[download] in: started"/&gt;
        &lt;/log&gt;
        &lt;property name="OUT_ONLY" value="true" scope="default" type="STRING"/&gt;
        &lt;property name="transport.vfs.ContentType" value="text/xml" scope="transport" type="STRING"/&gt;
        &lt;property name="transport.vfs.FileURI" value="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2013.xml" scope="transport" type="STRING"/&gt;
        &lt;log level="headers"&gt;
           &lt;property name="?" value="[download] in: sending over vfs"/&gt;
        &lt;/log&gt;
        &lt;send&gt;
           &lt;endpoint&gt;
              &lt;address uri="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2013.xml"/&gt;
           &lt;/endpoint&gt;
        &lt;/send&gt;
        &lt;log level="headers"&gt;
           &lt;property name="?" value="[download] in: ended"/&gt;
        &lt;/log&gt;
     &lt;/in&gt;
     &lt;out&gt;
        &lt;log level="headers"&gt;
           &lt;property name="?" value="[download] out: started"/&gt;
        &lt;/log&gt;
        &lt;send/&gt;
        &lt;log level="headers"&gt;
           &lt;property name="?" value="[download] out: ended"/&gt;
        &lt;/log&gt;
     &lt;/out&gt;
  &lt;/sequence&gt;
  </code></pre>
  
  <p><strong>So, how to download a <em>large</em> file over HTTP with WSO2 ESB?</strong></p>