The VFS transport implementation is based on Apache Commons VFS implementation. VFS (Virtual File System) transport implementation is a module which belongs to the Apache Synapse project. It has a set of service level parameters that needs to be specified for each service.
VFS service level parameters and their descriptions can be found in [1] and the endpoint formats can be found in [2].
Following is a sftp sample for ESB 3.0.1. It copies a file from one sftp location to another sftp folder. SFTPVFSProxy is the proxy service which copies file from one sftp location to another.
If you need further information or need help troubleshooting this sample refer [5].
VFS service level parameters and their descriptions can be found in [1] and the endpoint formats can be found in [2].
Following is a sftp sample for ESB 3.0.1. It copies a file from one sftp location to another sftp folder. SFTPVFSProxy is the proxy service which copies file from one sftp location to another.
If you need further information or need help troubleshooting this sample refer [5].
Following is the XML file (test.xml) that is being moved.
<proxy name="SFTPVFSProxy" transports="vfs" startOnLoad="true" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<log level="full"/>
<property name="File" expression="fn:concat('test-', get-property('transport', 'FILE_PATH'))" scope="default"/>
<property name="transport.vfs.ReplyFileName" expression="fn:concat(fn:substring-after(get-property('MessageID'), 'urn:uuid:'), '.xml')" scope="transport"/>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint name="endpoint_urn_uuid_A1546EFFD75FC9CCED785986339425964585275">
<address uri="vfs:sftp://heshan:password@10.101.1.112/home/heshan/out"/>
</endpoint>
</send>
</inSequence>
</target>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.PollInterval">15</parameter>
<parameter name="transport.vfs.MoveAfterProcess">vfs:sftp://heshan:password@10.101.1.112/home/heshan/original</parameter>
<parameter name="transport.vfs.FileURI">vfs:sftp://heshan:password@10.101.1.112/home/heshan/in/test.xml</parameter>
<parameter name="transport.vfs.MoveAfterFailure">vfs:sftp://heshan:password@10.101.1.112/home/heshan/original</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.xml</parameter>
<parameter name="transport.vfs.ContentType">application/xml</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
<soapenv:Body>
<getQuote xmlns="http://services.samples">
<request>
<symbol>IBM</symbol>
</request>
</getQuote>
</soapenv:Body>
</soapenv:Envelope>
[1] - http://wso2.org/project/esb/java/3.0.1/docs/transports/transports-catalog.html#VfsTrp
[2] - http://commons.apache.org/vfs/filesystems.html#SFTP
[3] - http://wso2.org/project/esb/java/3.0.1/docs/samples/transport_samples.html#Sample254
[4] - http://wso2.org/project/esb/java/3.0.1/docs/samples/transport_samples.html#Sample255
[5] - http://wso2.org/library/tutorials/2011/01/sftp-file-transer-wso2-esb
[2] - http://commons.apache.org/vfs/filesystems.html#SFTP
[3] - http://wso2.org/project/esb/java/3.0.1/docs/samples/transport_samples.html#Sample254
[4] - http://wso2.org/project/esb/java/3.0.1/docs/samples/transport_samples.html#Sample255
[5] - http://wso2.org/library/tutorials/2011/01/sftp-file-transer-wso2-esb
No comments:
Post a Comment