问题
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