jacksphere
jacksphere

Reputation: 31

Can we append the data in single text file using WSO2ESB?

I am getting error message from mobile app or somewhere any of front end.

I need keep that message in one single text file. That file could be stored in my local system.

How can I do this using WSO2ESB?

  <proxy xmlns="http://ws.apache.org/ns/synapse" name="AppendFile" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
       <target>
          <inSequence onError="fault">
             <property name="error_TYPE" expression="//error/text()" scope="axis2" type="STRING"/>
             <property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
             <payloadFactory>
                <format>
                   <error></error>
                </format>
                <args>
                   <arg expression="get-property('error')"/>

                </args>
             </payloadFactory>
               <send>
    <endpoint>
    <address uri="//home/desktop/append.txt"/>
    </endpoint>
    </send>
          </inSequence>
          <outSequence>
             <property name="CONTENT_TYPE" value="application/json" scope="axis2"/>
             <log level="full"/>
             <send/>
          </outSequence>
       </target>
       <description></description>
    </proxy>

But its giving transport error.

How can we do this? Please suggest.

Upvotes: 0

Views: 359

Answers (2)

Ratha
Ratha

Reputation: 9692

what is the error you got? Anyway the endpoint you gave looks wrong. It should start with the transport protocol as vfs://

eg: vfs:file:///home/desktop/append.txt

Upvotes: 0

Related Questions