Hi Aditya,

At the vfs code level, we first create the output file [1]
<https://github.com/wso2/wso2-synapse/blob/master/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportSender.java#L292>
and
then write content to that created file [2]
<https://github.com/wso2/wso2-synapse/blob/master/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSTransportSender.java#L367>.
Therefore, you need to have all create/write/append permission for the
response file. Please check your permission at the out directory as
mentioned above.

Thanks,
Prabushi

[1] - https://github.com/wso2/wso2-synapse/blob/master/
modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/
VFSTransportSender.java#L292
[2] - https://github.com/wso2/wso2-synapse/blob/master/
modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/
VFSTransportSender.java#L367

On Thu, Feb 22, 2018 at 3:30 PM, Chanika Geeganage <chan...@wso2.com> wrote:

> Hi Aditya,
>
> You need to have write access to this folder to create a file. Can you
> check the permissions given for the user in this location. And also to find
> out the absolute path in windows for FTP, [1] might be helpful.
>
> [1] https://superuser.com/questions/1103547/how-to-form-
> ftp-url-using-absolute-path-in-windows
>
> Thanks
>
> On Thu, Feb 22, 2018 at 3:24 PM, aditya shivankar <
> shivankar.adit...@gmail.com> wrote:
>
>>
>> I am able to access the remote folder using same credentials and ftp
>> protocol in Filezilla.
>> Since I am using the same credentials , I think I have the permissions.
>>
>> With Regards,
>> Aditya
>>
>> On Thu, Feb 22, 2018 at 3:15 PM, Himasha Guruge <himas...@wso2.com>
>> wrote:
>>
>>> 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:subst
>>>> ring-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@w
>>>> indowsServerIp/output"/>
>>>>                 </endpoint>
>>>>             </send>
>>>>         </inSequence>
>>>>         <outSequence/>
>>>>         <faultSequence/>
>>>>     </target>
>>>>     <parameter name="transport.PollInterval">15</parameter>
>>>>     <parameter name="transport.vfs.FileURI">f
>>>> ile:///C:/Flatfile/input</parameter>
>>>>     <parameter name="transport.vfs.ContentTyp
>>>> e">application/xml</parameter>
>>>>     <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
>>>>     <parameter name="transport.vfs.MoveAfterF
>>>> ailure">file:///C:/Flatfile/failure</parameter>
>>>>     <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
>>>>     <parameter name="transport.vfs.FileNamePattern">.*\.xml</parameter>
>>>>     <parameter name="transport.vfs.MoveAfterP
>>>> rocess">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@w
>>>> indowsServerIp/output"/>
>>>>       </endpoint>
>>>>   </send>
>>>> ------------------------------------------
>>>> 2.
>>>> <send>
>>>>       <endpoint>
>>>>           <address uri="ftp://username:password@w
>>>> indowsServerIp/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 <+94%2077%20745%209299>
>>> himas...@wso2.com
>>>
>>
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Best Regards..
>
> Chanika Geeganage
> +94773522586 <+94%2077%20352%202586>
> WSO2, Inc.; http://wso2.com
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Prabushi Samarakoon*
Software Engineer
Mobile: +94715434580
Email: prabus...@wso2.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to