This documentation is for WSO2 Enterprise Integrator version 6.1.1 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc
Skip to end of metadata
Go to start of metadata

Note that WSO2 EI is shipped with the following changes to what is mentioned in this documentation :

  • <PRODUCT_HOME>/ repository/samples/ directory that includes all Integration profile samples is changed to <EI_HOME>/ samples/service-bus/.
  • <PRODUCT_HOME>/ repository/samples/resources/ directory that includes all artifacts related to the Integration profile samples is changed to <EI_HOME>/ samples/service-bus/resources/.

Objective: Switching from FTP transport listener to mail transport sender.


  • You will need access to an FTP server and an SMTP server to try this sample.
  • Start the Axis2 server and deploy the SimpleStockQuoteService if not already done.
  • Enable mail transport sender in the ESB axis2.xml.
  • Create a new test directory in the FTP server. Open <EI_HOME>/samples/service-bus/synapse_sample_255.xml and edit the following values. Change the transport.vfs.FileURI parameter value point to the test directory at the FTP server. Change the outSequence endpoint address URI email address to a working email address. Values you have to change are marked with "<!--CHANGE-->".
  • Start the Synapse configuration numbered 255: -sn 255
  • Copy <EI_HOME>/samples/service-bus/resources/vfs/test.xml to the ftp directory given in transport.vfs.FileURI below.
<definitions xmlns="">
	<proxy name="StockQuoteProxy" transports="vfs">
    	<parameter name="transport.vfs.FileURI">vfs:ftp://guest:[email protected]/test?vfs.passive=true</parameter> <!--CHANGE-->
        <parameter name="transport.vfs.ContentType">text/xml</parameter>
        <parameter name="transport.vfs.FileNamePattern">.*\.xml</parameter>
        <parameter name="transport.PollInterval">15</parameter>
            	<header name="Action" value="urn:getQuote"/>
            	<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
            	<property action="set" name="OUT_ONLY" value="true"/>
                		<address uri="mailto:[email protected]"/> <!--CHANGE-->
        <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>

VFS transport listener will pick the file from the directory in the FTP server and send it to the Axis2 service. The file in the FTP directory will be deleted. The response will be sent to the given e-mail address.

Setting up Mail Transport Sender

To enable the mail transport sender for samples, you need to uncomment the mail transport sender configuration in the <EI_HOME>/conf/axis2/axis2.xml. Uncomment the mail transport sender sample configuration and make sure it points to a valid SMTP configuration for any actual scenarios.

<transportSender name="mailto" class="org.apache.synapse.transport.mail.MailTransportSender">
    <parameter name=""></parameter>
    <parameter name="mail.smtp.port">587</parameter>
    <parameter name="mail.smtp.starttls.enable">true</parameter>
    <parameter name="mail.smtp.auth">true</parameter>
    <parameter name="mail.smtp.user">synapse.demo.0</parameter>
    <parameter name="mail.smtp.password">mailpassword</parameter>
    <parameter name="mail.smtp.from">[email protected]</parameter>
  • No labels