Note that WSO2 EI is shipped with the following changes to what is mentioned in this documentation :
repository/samples/directory that includes all Integration profile samples is changed to
repository/samples/resources/directory that includes all artifacts related to the Integration profile samples is changed to
This sample demonstrates how to use the VFS transport to access a windows share.
- Create a directory named test on a windows machine and create three sub directories named in, out and original within the test directory.
- Grant permission to the network users to read from and write to the test directory and sub directories.
- Open the
<EI_HOME>/samples/service-bus/synapse_sample_265.xml file in a text editor and change the
transport.vfs.MoveAfterFailureparameter values to the in, original and original directory locations respectively. You have to also change the
<outSequence>endpoint address uri to the out directory location. Make sure that the prefix
vfs:in the endpoint address uri is not removed or changed.
- Enable the VFS transport. For details, see Enable VFS.
- For a list of general prerequisites, see Prerequisites to Start the ESB Samples.
Building the sample
The XML configuration for this sample is as follows:
This configuration file
synapse_sample_265.xml is available in the
<EI_HOME>/samples/service-bus directory and the values you have to change as specified in the prerequisites section are marked with
To build the sample
Start the ESB with the sample 265 configuration. For instructions on starting a sample ESB configuration, see Starting the ESB with a sample configuration.
The operation log keeps running until the server starts, which usually takes several seconds. Wait until the server has fully booted up and displays a message similar to "WSO2 Carbon started in n seconds."
Start the Axis2 server. For instructions on starting the Axis2 server, see Starting the Axis2 server.
Deploy the back-end service SimpleStockQuoteService. For instructions on deploying sample back-end services, see Deploying sample back-end services.
Executing the sample
The sample client used here is the Stock Quote Client, which can operate in several modes. For further details on this sample client and its operation modes, see Stock Quote Client.
To execute the sample client
test.xml file from the
<EI_HOME>/samples/service-bus/resources/vfs directory to the location specified in
transport.vfs.FileURI in the configuration (i.e., the in directory).
test.xml file contains a simple stock quote request in XML/SOAP format and is as follows:
Analyzing the output
You will see that the VFS transport listener picks the file from the in directory and sends it to the Axis2 service over HTTP. Then you will see that the request XML file is moved to the original directory and that the response from the Axis2 server is saved to the out directory.