使用 vfs 写入文件时从输出中删除 <text>-tag

remove <text>-tag from output while writing file with vfs

我想按顺序编写一个文件,其中有效负载为 csv(作为 plan taxt)。 我的问题是我总是得到 <text xmlns="http://ws.apache.org/commons/ns/payload">-围绕我的数据的标签。

有人可以帮我删除这个标签吗?

结果:

    <text xmlns="http://ws.apache.org/commons/ns/payload">HALLO 13,hallo 11,hallo 12,hallo 11hallo 12
HALLO 23,hallo 21,hallo 22,hallo 21hallo 22
HALLO 33,hallo 31,hallo 32,hallo 31hallo 32</text>

序列:

<?xml version="1.0" encoding="UTF-8"?>
<sequence name="fileWriteSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">

    <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
    <property expression="fn:concat( get-property('NewFileName'), '.', get-property('NewFileFormat'))" name="transport.vfs.ReplyFileName" scope="transport" type="STRING" xmlns:ns2="http://org.apache.synapse/xsd"/>
    <property name="messageType" scope="axis2-client" type="STRING" value="text/plain"/> 
    <send>
        <endpoint name="FileEpr">
            <address format="pox" uri="vfs:file:///C:/WSO2/ESB/VFS/OUTPUT/"/>
        </endpoint>
    </send>
</sequence>

这对于旧版本的 WSO2 产品运行良好,我们也面临与 WSO2 EI 6.3.0 和 6.2.0 版本相同的问题。

WSO2 似乎对消息格式化程序方向逻辑进行了更改,因为 format="pox" 是在端点级别定义的。它忽略了较新版本中的 messageType 属性。因此,您必须从地址端点中删除端点格式配置。

所以你需要改变你的逻辑如下:

<?xml version="1.0" encoding="UTF-8"?>
<sequence name="fileWriteSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">

    <property action="set" name="OUT_ONLY" value="true"/>
    <property expression="fn:concat( get-property('NewFileName'), '.', get-property('NewFileFormat'))" name="transport.vfs.ReplyFileName" scope="transport" type="STRING" xmlns:ns2="http://org.apache.synapse/xsd"/>
    <property name="messageType" value="text/plain" scope="axis2"/>
    <property name="ContentType" value="text/plain" scope="axis2"/>
    <send>
        <endpoint name="FileEpr">
            <address uri="vfs:file:///C:/WSO2/ESB/VFS/OUTPUT/"/>
        </endpoint>
    </send>
</sequence>