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

泪湿孤枕 提交于 2019-12-12 02:58:37

问题


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.


回答1:


You can use VFS transport. Please refer.

http://achala11.blogspot.com/2012/08/vfs-transport-wso2-esb-using-file.html

http://docs.wso2.org/wiki/display/ESB460/VFS+Transport

http://docs.wso2.org/wiki/pages/viewpage.action?pageId=16846489




回答2:


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


来源:https://stackoverflow.com/questions/15765141/can-we-append-the-data-in-single-text-file-using-wso2esb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!