How to setup VFS transport in WSO2 ESB with Samba

Environment: WS02 ESB 4.8.1, Samba 4.1.11, Ubuntu 14.10

Install Samba:

apt-get update
apt-get install samba

Configure two Samba shares:

  path = /tmp/samba/in
  available = yes
  valid users = deep
  read only = no
  browseable = yes
  public = yes
  writable = yes
  guest ok = no

  path = /tmp/samba/out
  available = yes
  valid users = deep
  read only = no
  browseable = yes
  public = yes
  writable = yes
  guest ok = no

Set passwd for user deep:

smbpasswd -a deep

Enable VFS transport ( transport sender and listener ) in ESB:


<transportReceiver name="vfs" class="org.apache.synapse.transport.vfs.VFSTransportListener"/>

<transportSender name="vfs" class="org.apache.synapse.transport.vfs.VFSTransportSender"/>

Now you can create a VFS enabled ESB proxy:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns=""
         <address uri="http://localhost:9000/services/SimpleStockQuoteService"
         <property name="transport.vfs.ReplyFileName"
                   expression="fn:concat(fn:substring-after(get-property('MessageID'), 'urn:uuid:'), '.xml')"
         <property name="OUT_ONLY" value="true"/>
               <address uri="vfs:smb://deep:deep@localhost/SambaShareOut/reply.xml"/>
   <parameter name="transport.PollInterval">5</parameter>
   <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
   <parameter name="transport.vfs.FileURI">vfs:smb://deep:deep@localhost/SambaShareIn</parameter>
   <parameter name="transport.vfs.MoveAfterProcess">vfs:smb://deep:deep@localhost/SambaShareOut</parameter>
   <parameter name="transport.vfs.MoveAfterFailure">vfs:smb://deep:deep@localhost/SambaShareOut</parameter>
   <parameter name="transport.vfs.FileNamePattern">.*\.xml</parameter>
   <parameter name="transport.vfs.ContentType">text/xml</parameter>
   <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>

Now you can copy a SOAP message (test.xml) to location “smb://deep:deep@localhost/SambaShareIn” then ESB will poll for new files with extension “.xml” and send it to the give service. Response will by copy to the location “smb://deep:deep@localhost/SambaShareOut”


<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="" xmlns:wsa="">
        <m0:getQuote xmlns:m0="http://services.samples">

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s