【发布时间】:2016-01-19 00:09:23
【问题描述】:
我收到了来自 WSO2 ESB 中 WS 的响应,我将此 xml 文件写入本地计算机上的目录中。我想根据内容更改.xml文件的名称。以下是用于写入文件的序列代码:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="WriteFile">
<property name="transport.vfs.ReplyFileName" value="MyFile.xml" scope="transport"></property>
<property name="OUT_ONLY" value="true"></property>
<send>
<endpoint>
<address uri="vfs:file:///C:\MyFolder"></address>
</endpoint>
</send>
</sequence>
现在,如果我在 WS 响应的特定标记中找到“MyFile_2”,我想要 MyFile_2.xml,或者如果我找到“MyFile_3”,则使用 MyFile_3.xml,依此类推。我想我必须参数化我的序列,特别是 value="MyFile.xml" 但我不明白该怎么做。
编辑:那么 SOAP 响应呢?我有一个这样的 SOAP 答案:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap..............>
<soap:Body>
<QueryStructureResponse xmlns="..........>
<QueryStructureResult>
<RegistryInterface xmlns="ht............>
<Header>
<ID>IT1001</ID>
<Test>true</Test>
<Name xml:lang="en">MY_FILENAME</Name>
............
我以类似的方式尝试过,但是当我想调用包含 MY_FILENAME 的文件时出现问题。 以前的 REST 响应操作没问题,Jean-Michel 的回答很好。
【问题讨论】:
标签: wso2 response sequence wso2esb transport