Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Deploy the back-end service (SimpleStockQuoteService) in the Axis2 server. For instructions on deploying sample back-end services, see Deploying sample back-end services.

  2. Start the Axis2 server. For instructions on starting the Axis2 server, see Starting the Axis2 server.
  3. Enable the plain text message builder in the axis2.xml file (found in the <EI_HOME>/conf directory) as shown below.


    Code Block
    languagehtml/xml
    <messageBuilder contentType="text/plain" class="org.apache.axis2.format.PlainTextBuilder"/>
  4. Enable the vfs transport in the axis2.xml file by uncommenting the vfs transport sender and receiver configurations as shown below.
    Code Block
    <transportReceiver name="vfs" class="org.apache.synapse.transport.vfs.VFSTransportListener"/>
    <transportSender name="vfs" class="org.apache.synapse.transport.vfs.VFSTransportSender"/>
  5. Create three folders on your computer for the following purposes:

    • To store the original text file with the EDI message.

    • To store the text file with the EDI message after the file has been successfully processed by the Smooks mediator.
    • To store the text file with the EDI message if the file processing fails.
  6. Update the sample configuration file (which is the synapse_sample_654.xml file found in the <EI_HOME>/samples/service-bus directory) with the paths to the folders created in the previous step. Listed below are the parameters you need to update:

    • transport.vfs.FileURI: This parameter specifies the path to the folder that stores the text file with the EDI message.
    • transport.vfs.MoveAfterProcess: This specifies the path to the folder that stores the same text file after it is successfully converted by the Smooks mediator.
    • transport.vfs.ActionAfterFailure: This specifies the path to the folder that stores the same text file if an error occurs during the processing.

    See the following example of the sample configuration:

    Code Block
    <parameter name="transport.vfs.FileURI">file:///home/user/test/in</parameter>
    <parameter name="transport.vfs.MoveAfterProcess">file:///home/user/test/original</parameter>
    <parameter name="transport.vfs.MoveAfterFailure">file:///home/user/test/original</parameter>

Executing the sample

Now you need to add a text file with an EDI message to the folder you specified for the transport.vfs.FileURI parameter in the sample configuration and run the sample. WSO2 EI is shipped with a sample text file with an EDI message: This is the edi.txt file stored in the <EI_HOME>/samples/service-bus/resources/smooks directory. 

...

Follow the steps given below.

  1. Start the ESB profile of WSO2 EI with the sample 654 configuration. For instructions on starting a sample configuration, see Starting 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."

  2. Now you need to provide a text file with an EDI message. WSO2 EI is shipped with a sample file named edi.txt inside the <EI_HOME>/samples/service-bus/resources/smooks directory. Copy this edi.txt file to the folder you specified for the transport.vfs.FileURI parameter in the sample configuration.

Analyzing the output

The Smooks mediator will first translate the EDI message into XML as shown below.

...