本文介绍了我们如何使用 wso2esb 将数据写入文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在从前端获取数据或字符串 我正在一个属性中设置数据或字符串每次他们发送数据时我都需要在文本文件中发送该属性数据我需要将数据保存在同一个文件中而不覆盖我该怎么做我已经使用 VFS 传输完成了我在配置文件中取消了 vfs 的发件人部分的注释,即使它不是在配置下工作正常

i am getting a data or string from front end i am setting the data or string in one propertythat property data i need to send in text file every time they will send the data i need keep the data in same file without override how can i do i have done using VFS transport i uncommented sender section of vfs in configuration file even though its not working fine below configuration

    <?xml version="1.0" encoding="UTF-8"?>
    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="FileWrite"
           transports="https http"
           startOnLoad="true"
           trace="disable">
       <description/>
       <target>
          <inSequence>
             <property name="error" expression="//error/text()" scope="default"/>
             <log level="full"/>
          </inSequence>
          <outSequence>
             <log>
 <property name="error" expression="get-property('error')" scope="default"/>
                <property name="OUT_ONLY" value="true"/>
             </log>
             <payloadFactory>
                <format>
                   <error>$1</error>
                </format>
                <args>
                   <arg expression="get-property('error')"/>
                </args>
             </payloadFactory>
             <log level="full"/>
             <send>
                <endpoint>
                   <address uri="vfs:file:///home/youtility2/Desktop/Errorlog.text"/>
                </endpoint>
             </send>
             <log level="full"/>
          </outSequence>
       </target>
       <parameter name="transport.vfs.Append">true</parameter>
    </proxy>

我在桌面上创建了文本文件,但数据没有写入文本文件,也没有给出任何异常也将为此引用一些内容

i created text file on desktop but data is not writing in text file and also not giving any exception also will refer something for this

推荐答案

您必须为代理服务启用 VFS 传输.在代理创建/编辑向导中,您可以选择必要的传输.在axis2.xml 中启用VFS 传输后,VFS 将作为可用的服务传输出现.因此,如果要在代理服务中使用它,则也应该为该特定服务启用它.

You have to enable VFS Transport for the Proxy service. In proxy creation/edit wizard you can select necessary transports. Once you have enabled VFS transport in axis2.xml, VFS will apear as an available transport for services. So if it is to use in a proxy service it should be enabled to that particular service as well.

因此在您的代理元素中,传输属性将为 transports="https http vfs"

So in your proxy element, transport attribute will be transports="https http vfs"

为了附加到同一个文件,请使用文档 [2] 中所述的文件 URI 定义 transport.vfs.Append 参数

In order to append to the same file, define the transport.vfs.Append parameter with the file URI as described in the doc[2]

[2]http://docs.wso2.org/wiki/display/ESB450/VFS+传输

    <?xml version="1.0" encoding="UTF-8"?>
    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="FileWrite"
           transports="https http vfs"
           startOnLoad="true"
           trace="disable">
       <description/>
       <target>
          <inSequence>
             <property name="OUT_ONLY" value="true"/>
             <property name="error" expression="//error/text()" scope="default"/>
             <log level="full"/>
          </inSequence>
          <outSequence>
             <log>
 <property name="error" expression="get-property('error')" scope="default"/>
                <property name="OUT_ONLY" value="true"/>
             </log>
             <payloadFactory>
                <format>
                   <error>$1</error>
                </format>
                <args>
                   <arg expression="get-property('error')"/>
                </args>
             </payloadFactory>
             <log level="full"/>
             <send>
                <endpoint>
                   <address uri="vfs:file:///home/youtility2/Desktop/Errorlog.text?transport.vfs.Append=true"/>
                </endpoint>
             </send>
             <log level="full"/>
          </outSequence>
       </target>
       <parameter name="transport.vfs.Append">true</parameter>
    </proxy>

这篇关于我们如何使用 wso2esb 将数据写入文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 01:29