0
votes

I'm new on SOA concepts and WSO2 ESB so i use tutorials that i can find on web. I'm trying to use WSO2 ESB to make file operations, especially a copy from local file system.

As it is explained in this topic : http://wso2.com/library/articles/2012/01/wso2-esb-example-file-exchanging-hub-part-1/#read-file

I deploy my service on my carbon server and i can see it. But when i click on "Try this service", nothing happens. The files are not copied and no log messages appeared in the console server.

Here is my "FileSystemVFSProxy.xml" content :

<?xml version="1.0" encoding="UTF-8"?>
<proxy name="FileSystemVFSProxy" startOnLoad="true" trace="disable"
transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
    <target>`enter code here`
    <inSequence>
        <log level="full"/>
    <drop/>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="transport.PollInterval">15</parameter>
<parameter name="transport.vfs.FileURI">file://localhost/c:/test</parameter>
<parameter name="transport.vfs.ContentType">text/xml</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.MoveAfterFailure">file://localhost/c:/test/erreur</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.FileNamePattern">.*\.txt</parameter>
<parameter name="transport.vfs.MoveAfterProcess">file://localhost/c:/test/destination</parameter>
</proxy>

1) Is my config correct ?

2) How can i use my service ?

Thanks

2
You should have 3 slashes after file:.Maria Ivanova

2 Answers

1
votes

Try with that (no localhost in vfs url for a local file) and don't forget that the directories must exists :

<?xml version="1.0" encoding="UTF-8"?>
<proxy name="FileSystemVFSProxy" startOnLoad="true" trace="disable" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
    <target>
        <inSequence>
            <log level="full"/>
            <drop/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </target>
    <parameter name="transport.PollInterval">15</parameter>
    <parameter name="transport.vfs.FileURI">file:///C:/test</parameter>
    <parameter name="transport.vfs.ContentType">text/xml</parameter>
    <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
    <parameter name="transport.vfs.MoveAfterFailure">file:///C:/test/erreur</parameter>
    <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
    <parameter name="transport.vfs.FileNamePattern">.*\.txt</parameter>
    <parameter name="transport.vfs.MoveAfterProcess">file:///C:/test/destination</parameter>
</proxy>
0
votes

My problem is solved. As mentionned by Jean-Michel, my URI was wrong and it's not possible to use 'file://localhost/xxx' for local file system.

And there was another problem in my configuration. It's necessary to enable vfs transport in the axis2.xml file server.

we can find it in documentation : https://docs.wso2.com/display/ESB500/VFS+Transport

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

Thanks for answers