对于 WSO2 Microintegrator 项目,我需要读取 JSON 文件。为了练习使用文件连接器(读取中介器),我这样做了:
项目代码是这样的:
<api context="/read" name="init" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" uri-template="/json">
<inSequence>
<file.read configKey="FILE_CONNECTION_1">
<path>test.json</path>
<readMode>Complete File</readMode>
<includeResultTo>Message Body</includeResultTo>
<enableStreaming>false</enableStreaming>
<enableLock>false</enableLock>
</file.read>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
就像触发文件读取操作的 REST API 一样简单。 当导出工件并在 Integration Studio 的集成服务器上运行它时,会出现以下消息
配置元素引用的未知中介:{http://ws.apache.org/ns/synapse}file
出现,并且应用程序已取消部署。我认为这个问题已经被报告,但没有给出解决方案。是否是连接器和服务器或Integration Studio版本的问题? 工作室版本:8.2.0 服务器版本:4.2.0(外部服务器中的 4.3.0 也具有相同的结果) 文件连接器版本:4.0.32
有什么想法吗?其他建议的连接器? 预先感谢