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