Synapse
  1. Synapse
  2. SYNAPSE-851

VFS proxy generates the response.xml with empty content (Synapse-2.2.0-Snapshot trunk)

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: NIGHTLY
    • Fix Version/s: FUTURE
    • Component/s: Transports
    • Labels:
      None

      Description

      Used following configuration;
      I see the output(response.xml) at "out" folder is empty..
      <proxy name="StockQuoteProxy" transports="vfs" startOnLoad="true" trace="disable">
      <target faultSequence="fault">
      <inSequence>
      <property name="OUT_ONLY" value="true"/>
      <send>
      <endpoint>
      <address uri="vfs:file:C:\Users\TOSHIBA\Desktop\out"/>
      </endpoint>
      </send>
      </inSequence>
      </target>
      <parameter name="transport.PollInterval">15</parameter>
      <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
      <!-<parameter name="transport.vfs.FileURI">vfs:ftp://anonymous@localhost/in?vfs.passive=true</parameter>->
      <parameter name="transport.vfs.FileURI">file:C:\Users\TOSHIBA\Desktop\in</parameter>
      <parameter name="transport.vfs.MoveAfterProcess">file:C:\Users\TOSHIBA\Desktop\original</parameter>
      <parameter name="transport.vfs.MoveAfterFailure">file:C:\Users\TOSHIBA\Desktop\error</parameter>
      <parameter name="transport.vfs.FileNamePattern">.*</parameter>
      <parameter name="transport.vfs.ContentType">text/plain</parameter>
      <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
      <parameter name="serviceType">proxy</parameter>
      </proxy>

        Activity

        Vijayaratha Vijayasingam created issue -
        Hide
        Vijayaratha Vijayasingam added a comment - - edited

        This is not working in the latest Synapse 2.1 release too..

        Show
        Vijayaratha Vijayasingam added a comment - - edited This is not working in the latest Synapse 2.1 release too..
        Hide
        Dushan Sachinda Abeyruwan added a comment -

        Hi
        I just check this with synapse-2.2.0-SNAPSHOT and its working fine for me and can see the response content with expected results this is my configuration

        <proxy name="StockQuoteProxy" transports="https http vfs" startOnLoad="true" trace="disable">
        <target>
        <endpoint>
        <address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap12"/>
        </endpoint>
        <outSequence>
        <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>
        <address uri="vfs:file:///home/dushan/poc/esbvfs/out"/>
        </endpoint>
        </send>
        </outSequence>
        </target>
        <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
        <parameter name="transport.PollInterval">15</parameter>
        <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
        <parameter name="transport.vfs.FileURI">file:///home/dushan/poc/esbvfs/in</parameter>
        <parameter name="transport.vfs.MoveAfterProcess">file:///home/dushan/poc/esbvfs/done</parameter>
        <parameter name="transport.vfs.MoveAfterFailure">file:///home/dushan/poc/esbvfs/done</parameter>
        <parameter name="transport.vfs.FileNamePattern">.*.xml</parameter>
        <parameter name="transport.vfs.ContentType">text/xml</parameter>
        <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
        </proxy>

        Show
        Dushan Sachinda Abeyruwan added a comment - Hi I just check this with synapse-2.2.0-SNAPSHOT and its working fine for me and can see the response content with expected results this is my configuration <proxy name="StockQuoteProxy" transports="https http vfs" startOnLoad="true" trace="disable"> <target> <endpoint> <address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap12"/> </endpoint> <outSequence> <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> <address uri="vfs: file:///home/dushan/poc/esbvfs/out "/> </endpoint> </send> </outSequence> </target> <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/> <parameter name="transport.PollInterval">15</parameter> <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter> <parameter name="transport.vfs.FileURI"> file:///home/dushan/poc/esbvfs/in </parameter> <parameter name="transport.vfs.MoveAfterProcess"> file:///home/dushan/poc/esbvfs/done </parameter> <parameter name="transport.vfs.MoveAfterFailure"> file:///home/dushan/poc/esbvfs/done </parameter> <parameter name="transport.vfs.FileNamePattern">.*.xml</parameter> <parameter name="transport.vfs.ContentType">text/xml</parameter> <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter> </proxy>
        Hiranya Jayathilaka made changes -
        Field Original Value New Value
        Assignee Hiranya Jayathilaka [ hiranya ]
        Hide
        Hiranya Jayathilaka added a comment -

        Hi Dushan,

        Looks like Ratha is trying this scenario with plain text files. The content type parameter has been set to text/plain. The scenario works fine with XML input files.

        In the latest trunk, this is the response.xml I get for a plain text input:

        <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><text xmlns="http://ws.apache.org/commons/ns/payload"/></soapenv:Body></soapenv:Envelope>

        The original input content was "HelloWorld". Looks like Synapse has dropped the text payload. I'm going to take a closer look.

        Thanks,
        Hiranya

        Show
        Hiranya Jayathilaka added a comment - Hi Dushan, Looks like Ratha is trying this scenario with plain text files. The content type parameter has been set to text/plain. The scenario works fine with XML input files. In the latest trunk, this is the response.xml I get for a plain text input: <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><text xmlns="http://ws.apache.org/commons/ns/payload"/></soapenv:Body></soapenv:Envelope> The original input content was "HelloWorld". Looks like Synapse has dropped the text payload. I'm going to take a closer look. Thanks, Hiranya
        Hide
        Hiranya Jayathilaka added a comment -

        I think Ratha has uncovered a serious bug here. This is what happens:

        1. VFS listener receives a plain text message. The plain text builder creates an OMSourcedElement to represent the message payload.
        2. When the ESB hits send, a new thread is spawned to handle the send operation. At this point the VFS listener thread returns and it closes the input stream to the input file.
        3. Now when the VFS sender attempts to format the message, the OMSourcedElement no longer have access to the original file input stream. So an empty payload is written out.

        Show
        Hiranya Jayathilaka added a comment - I think Ratha has uncovered a serious bug here. This is what happens: 1. VFS listener receives a plain text message. The plain text builder creates an OMSourcedElement to represent the message payload. 2. When the ESB hits send, a new thread is spawned to handle the send operation. At this point the VFS listener thread returns and it closes the input stream to the input file. 3. Now when the VFS sender attempts to format the message, the OMSourcedElement no longer have access to the original file input stream. So an empty payload is written out.
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Synapse - Trunk #4620 (See https://builds.apache.org/job/Synapse%20-%20Trunk/4620/)
        Some changes related to SYNAPSE-851; Adding plain text formatter to the AxisConfig by default (we already add the plain text builder by default). In the VFS sender, setting the default output file name to response.dat for potential non-XML outputs. (hiranya: rev 1504634)

        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Axis2SynapseController.java
        • /synapse/trunk/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSConstants.java
        • /synapse/trunk/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSUtils.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Synapse - Trunk #4620 (See https://builds.apache.org/job/Synapse%20-%20Trunk/4620/ ) Some changes related to SYNAPSE-851 ; Adding plain text formatter to the AxisConfig by default (we already add the plain text builder by default). In the VFS sender, setting the default output file name to response.dat for potential non-XML outputs. (hiranya: rev 1504634) /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Axis2SynapseController.java /synapse/trunk/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSConstants.java /synapse/trunk/java/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSUtils.java

          People

          • Assignee:
            Hiranya Jayathilaka
            Reporter:
            Vijayaratha Vijayasingam
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development