我们如何在wso2 esb中的txt文件中存储数据或字符串

问题描述 投票:1回答:2

我的问题是我从前端或移动应用程序获取数据或json或字符串,其中包含错误的详细信息我需要在我的本地系统中的单个txt文件中附加所有详细信息我该如何做到这一点我们有任何调解员为此或者我可以使用vfs trnsport让我知道我尝试使用此代码给出错误我的配置是:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="FileWrite" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
  <target>
     <inSequence>
        <log level="custom">
           <property name="sequence" value="fileWriteSequence"/>
        </log>
        <log>
           <property name="transport.vfs.ReplyFileName" expression="fn:substring-after(get-property('MessageID'), 'urn:uuid:')"/>
           <property name="OUT_ONLY" value="true"/>
        </log>
        <send>
           <endpoint>
              <address uri="///home/youtility2/Desktop/Errorlog"/>
           </endpoint>
        </send>
     </inSequence>
     <outSequence>
        <send/>
     </outSequence>
  </target>
  <parameter name="transport.vfs.ContentType">text/plain</parameter>
  <description></description>
</proxy>

从esb方面抛出错误

2013-04-01 15:58:04,707] ERROR - ClientUtils The system cannot infer the transport information from the ///home/youtility2/Desktop/Errorlog URL.
[2013-04-01 15:58:04,708] ERROR - Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: The system cannot infer the transport information from the ///home/youtility2/Desktop/Errorlog URL.
       at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81

)有任何转介让我知道。

wso2 wso2esb wso2dss
2个回答
1
投票

您需要将“transport.vfs.Append = true”附加到out-file URI以将数据附加到现有文件中...在stackoverflow中有一个关于此的线程,请参阅[1]。有关VFS的更多详细信息,请参阅[2]。

[1] How to append response message to a text file?

[2] http://docs.wso2.org/wiki/display/ESB403/VFS+Transport

问候,

磨憨


0
投票

序列在Log mediator中定义。定义如下

<inSequence>
        <log level="full"/>
           <property name="sequence" value="fileWriteSequence"/>

   <property name="transport.vfs.ReplyFileName" expression="fn:substring-after(get-property('MessageID'), 'urn:uuid:')"/>
           <property name="OUT_ONLY" value="true"/>

        <send>
           <endpoint>
              <address uri="///home/youtility2/Desktop/Errorlog"/>
           </endpoint>
        </send>
     </inSequence>
© www.soinside.com 2019 - 2024. All rights reserved.