How to transfer file between two ftp servers in WSO2 ESB?
<p>Using WSO2 ESB 4.9.0, I created a proxy service to transfer file from one FTP location to another.  In axis2.xml, I had enabled VFS Transport and configured messagebuilder and messageformatter for pdf contexttype accordingly.  But I got error saying "ERROR Axis2Sender Unexpected error during sending message out"</p>

<p>I am a newbie on ESB product. Can anyone help me understand the problem I encounter here?</p>

<p>My proxy service configuration:</p>

<p></p>

<pre><code>&lt;proxy name="StockQuoteProxy" transports="vfs"&gt;
    &lt;parameter name="transport.vfs.FileURI"&gt;ftp://{user}:{pwd}@{host}/{directory}&lt;/parameter&gt;
    &lt;!--CHANGE--&gt;
    &lt;parameter name="transport.vfs.ContentType"&gt;application/pdf&lt;/parameter&gt;
    &lt;parameter name="transport.vfs.FileNamePattern"&gt;.*\.pdf&lt;/parameter&gt;
    &lt;parameter name="transport.PollInterval"&gt;15&lt;/parameter&gt;
    &lt;parameter name="transport.vfs.MoveAfterProcess"&gt;file://C:/VFStest/original&lt;/parameter&gt;
    &lt;!--CHANGE--&gt;
    &lt;parameter name="transport.vfs.MoveAfterFailure"&gt;file://C:/VFStest/original&lt;/parameter&gt;
    &lt;!--CHANGE--&gt;
    &lt;parameter name="transport.vfs.ActionAfterProcess"&gt;MOVE&lt;/parameter&gt;
    &lt;parameter name="transport.vfs.ActionAfterFailure"&gt;MOVE&lt;/parameter&gt;

    &lt;target&gt;
        &lt;inSequence&gt;
            &lt;log description="Log Message" level="custom"&gt;
                &lt;property name="message" value="Transfering file"/&gt;
            &lt;/log&gt;
            &lt;property name="ClientApiNonBlocking" value="true" scope="axis2" action="remove"/&gt;
            &lt;send&gt;
                &lt;endpoint name="FileEP"&gt;
                    &lt;address uri="vfs:ftp://{user}:{pwd}@{host}/{directory}"/&gt;
                &lt;/endpoint&gt;
            &lt;/send&gt;
        &lt;/inSequence&gt;
    &lt;/target&gt;
    &lt;!--publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/--&gt;
&lt;/proxy&gt;
</code></pre>

<p></p>

<p>Exception trace:</p>

<pre><code>2016-05-06 14:38:01,037 [-] [vfs-Worker-2] ERROR Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: The VFS transport doesn't support synchronous responses. Please use the appropriate (out only) message exchange pattern.
    at org.apache.synapse.transport.vfs.VFSTransportSender.sendMessage(VFSTransportSender.java:116)
    at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
    at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:185)
    at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:167)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
    at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:542)
    at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:79)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:461)
    at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:372)
    at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:65)
    at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:105)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149)
    at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:185)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:328)
    at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFSTransportListener.java:751)
    at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirectory(VFSTransportListener.java:407)
    at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:177)
    at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:124)
    at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:67)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
2016-05-06 14:38:01,056 [-] [vfs-Worker-2]  WARN ProxyServiceMessageReceiver Executing fault handler due to exception encountered
2016-05-06 14:38:01,058 [-] [vfs-Worker-2]  WARN FaultHandler ERROR_CODE : 0
2016-05-06 14:38:01,059 [-] [vfs-Worker-2]  WARN FaultHandler ERROR_MESSAGE : Unexpected error during sending message out
2016-05-06 14:38:01,060 [-] [vfs-Worker-2]  WARN FaultHandler ERROR_DETAIL : org.apache.synapse.SynapseException: Unexpected error during sending message out
</code></pre>