Hi Aditya,

Please note below extraction from [1]. Therefore make sure proper
permissions are set. Are you receiving any error logs on this?

 "When you transfer a file to a remote FTP location via VFS, the ESB tries
to detect the FTP location by navigating from the root folder first. If the
ESB does not  have  at least list permission  to the root (/), the file
transfer fails."


[1] https://docs.wso2.com/display/EI611/VFS+Transport

Thanks,
Himasha

On Thu, Feb 22, 2018 at 2:30 PM, aditya shivankar <
shivankar.adit...@gmail.com> wrote:

> I wrote a application which is now able to poll files from  "input" folder
> on my local machine and put the esb processed files in "output folder" on
> my local machine.
>
> Code which worked for me for Flatfile(putting processed files to folder on
> local machine) is below
>
> <?xml version="1.0" encoding="UTF-8"?>
> <proxy name="StockQuoteProxy" startOnLoad="true" transports="vfs" xmlns="
> http://ws.apache.org/ns/synapse";>
>     <target>
>         <inSequence>
>             <log level="full">
>                 <property name="property_name" value="Read from file
> -----------------------"/>
>             </log>
>             <property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING"
> value="true"/>
>             <property name="REST_URL_POSTFIX" scope="axis2" type="STRING"
> value=""/>
>             <datamapper config="gov:datamapper/xmlToCsv1.dmc"
> inputSchema="gov:datamapper/xmlToCsv1_inputSchema.json" inputType="XML"
> outputSchema="gov:datamapper/xmlToCsv1_outputSchema.json"
> outputType="CSV"/>
>             <log level="full">
>                 <property name="property_name" value="after enrich
> -----------------------"/>
>             </log>
>             <property expression="fn:concat(fn:
> substring-after(get-property('MessageID'), 'urn:uuid:'), '.csv')"
> name="transport.vfs.ReplyFileName" scope="transport" type="STRING"/>
>             <property name="OUT_ONLY" scope="default" type="STRING"
> value="true"/>
>             <property name="messageType" scope="axis2" type="STRING"
> value="application/csv"/>
>             <send>
>                 <endpoint>
>                     <address uri="ftp://username:password@
> windowsServerIp/output"/>
>                 </endpoint>
>             </send>
>         </inSequence>
>         <outSequence/>
>         <faultSequence/>
>     </target>
>     <parameter name="transport.PollInterval">15</parameter>
>     <parameter name="transport.vfs.FileURI">file:///C:/Flatfile/input</
> parameter>
>     <parameter name="transport.vfs.ContentType">application/xml</
> parameter>
>     <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
>     <parameter name="transport.vfs.MoveAfterFailure">file:///C:/
> Flatfile/failure</parameter>
>     <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
>     <parameter name="transport.vfs.FileNamePattern">.*\.xml</parameter>
>     <parameter name="transport.vfs.MoveAfterProcess">file:///C:/Flatfile/
> orgFilesProcessedSuccessfully</parameter>
> </proxy>
>
>
> I am trying to modify it to write files in an "output" folder on a windows
> server, to which I have access. But it is not working for me.
> I tried changing the send block few times like below.
> --------------------------------------
> 1. <send>
>       <endpoint>
>           <address uri="ftp://username:password@windowsServerIp/output"/>
>       </endpoint>
>   </send>
> ------------------------------------------
> 2.
> <send>
>       <endpoint>
>           <address uri="ftp://username:password@
> windowsServerIp/D:/output"/>
>       </endpoint>
> </send>
> ----------------------------------------------
>
> In above send block while running the code , I replaced below keys like
>
> username : my username for windows server , with which I can connect to
> windows using ftp protocol in filezilla
>
> password : my password for windows server , with which I can connect to
> windows using ftp protocol in filezilla
>
> windowsServerIp : Ip of windows service machine.
>
> Please guide.
>
> With Regards,
> Aditya
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Himasha Guruge
Senior Software Engineer
WS*O2* *Inc.*
Mobile: +94 777459299
himas...@wso2.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to