【发布时间】:2015-06-12 12:41:07
【问题描述】:
提前感谢您的帮助:)
我正在尝试使用 tRestClient 发送带有 json 的请求,以在我的 web 服务中添加产品,其中包含属性库存的 json 数组
例如:
{
"handle": "iPad2",
"inventory": [
{
"outlet_name": "one",
"count": "100"
},
{
"outlet_name": "two",
"count": "200"
}
]
}
我有单行数据,其中一个句柄可以有多个出口和计数 所以我创造了这样的工作
这里的 tIdempiereInput 是我的自定义组件,它的作用类似于 tPostgresInput tIdempiereInput -> tXmlMap -> tRestClient
我的工作工作正常但我的问题是,它为每个句柄发送请求,而不是像这样将它们分组到单个对象中
请求 1)
{
"handle": "iPad2",
"inventory": [
{
"outlet_name": "one",
"count": "100"
}
]
}
请求 2)
{
"handle": "iPad2",
"inventory": [
{
"outlet_name": "two",
"count": "200"
}
]
}
所以它对每条记录发出不同的请求,而不是对出口进行分组并用句柄计数并为它发出单个请求!!
我知道 tAdvancedFileOutputXML 使用它,我们可以使用分组元素和循环生成具有嵌套结构的 XML,但不知道如何使用 tXmlMap 和 tRESTClient 做同样的事情..
【问题讨论】: