DataMapper 输入模式未读取所有 XML 负载
DataMapper input schema is not reading all the XML payload
我有一个 xml 负载,其中包含重复的节点,具体取决于响应。加载输入架构时,图表仅显示根元素中的第一次出现。
我希望 DataMapper 中介读取所有出现的事件,对其进行处理,然后将结果发送给客户端,而不是只处理第一次出现的事件。
我的 XML 输入如下:
<NVprotocol>
<CDMA>
<id>1</id>
<value>2</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
</NVprotocol>
但是 DataMapper 只处理第一个节点及其子节点。
有什么帮助吗?
When loading the input schema, the diagram shows only the first occurence in the root element.
即使它只显示第一次出现,它也会映射映射中的所有出现。
我正在使用以下输入和输出文件来创建映射:
input.xml
<NVprotocol>
<CDMA>
<id>1</id>
<value>2</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
</NVprotocol>
output.json
{
"NVprotocol": [
{
"CDMA": {
"id": 1,
"val": 2
}
},
{
"CDMA": {
"id": 3,
"val": 4
}
}
]
}
映射
实时 Datamapper 预览
之后,通过使用 导出复合应用程序项目 选项,在代理或 API 中保存并导出此数据映射。
然后发送带有以下正文的请求。
<NVprotocol>
<CDMA>
<id>1</id>
<value>2</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
</NVprotocol>
您将收到以下回复。
{
"NVprotocol": [
{
"CDMA": {
"id": 1,
"val": 2
}
},
{
"CDMA": {
"id": 5,
"val": 7
}
},
{
"CDMA": {
"id": 5,
"val": 7
}
},
{
"CDMA": {
"id": 5,
"val": 7
}
}
]
}
我有一个 xml 负载,其中包含重复的节点,具体取决于响应。加载输入架构时,图表仅显示根元素中的第一次出现。
我希望 DataMapper 中介读取所有出现的事件,对其进行处理,然后将结果发送给客户端,而不是只处理第一次出现的事件。
我的 XML 输入如下:
<NVprotocol>
<CDMA>
<id>1</id>
<value>2</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
</NVprotocol>
但是 DataMapper 只处理第一个节点及其子节点。
有什么帮助吗?
When loading the input schema, the diagram shows only the first occurence in the root element.
即使它只显示第一次出现,它也会映射映射中的所有出现。
我正在使用以下输入和输出文件来创建映射:
input.xml
<NVprotocol>
<CDMA>
<id>1</id>
<value>2</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
</NVprotocol>
output.json
{
"NVprotocol": [
{
"CDMA": {
"id": 1,
"val": 2
}
},
{
"CDMA": {
"id": 3,
"val": 4
}
}
]
}
映射
之后,通过使用 导出复合应用程序项目 选项,在代理或 API 中保存并导出此数据映射。
然后发送带有以下正文的请求。
<NVprotocol>
<CDMA>
<id>1</id>
<value>2</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
<CDMA>
<id>5</id>
<value>7</value>
</CDMA>
</NVprotocol>
您将收到以下回复。
{
"NVprotocol": [
{
"CDMA": {
"id": 1,
"val": 2
}
},
{
"CDMA": {
"id": 5,
"val": 7
}
},
{
"CDMA": {
"id": 5,
"val": 7
}
},
{
"CDMA": {
"id": 5,
"val": 7
}
}
]
}