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

标签 wso2 wso2-esb

我想按顺序编写一个有效负载为 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>

关于wso2 - 使用 vfs 写入文件时从输出中删除 <text>-tag,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51590214/

相关文章:

WSO2 如何将 ESB 与 Identity Server 集成

IP 客户端 WSO2 Esb

java - 如何将单个子 xml 元素转换为 Json 数组

svn - wso2 svn 更新 - E205011 : Failure occurred processing one or more externals definitions

wso2 - 在本地计算机上设置 WSO2 stratos

docker - Wso2 EI作为docker容器运行时日志的位置是什么

ssl - 如何指定在我的 axis2 https 发件人上使用哪些密码?

encryption - 安全加载数据源时出错。解密数据时出错

ubuntu - 如何在单个 localhost 上设置不同的 Wso2 AM 环境?

javascript - 大负载上的 WSO2ESB js 脚本调解器错误