2015-06-12 69 views
0

Thanxx在您的幫助:)
我試圖用tRestClient與JSON請求發送到我的web服務包含JSON數組的屬性庫存
前添加產品:發送JSON請求在Talend使用tRestClient和嵌套對象

{ 
"handle": "iPad2", 
"inventory": [ 
    { 
     "outlet_name": "one", 
     "count": "100" 
    }, 
    { 
     "outlet_name": "two", 
     "count": "200" 
    } 
] 
} 

我在單行數據,其中一個手柄可以有多個出口和計數 所以我必須創建自己的工作這樣

這裏tIdempiereInput是我的自定義組件,它會像TPO stgresInput tIdempiereInput - > tXmlMap - > tRestClient

 component i have used tRestClient to

Map handle ,outlet and count using tXmlMap sot it will convert my row date in document which will be used by tRestClient outlet

我的工作,工作正常,但我的問題是,它爲每個手柄發送請求,而不將它們組合在單個對象這樣
請求1 )

{ 
"handle": "iPad2", 
"inventory": [ 
    { 
     "outlet_name": "one", 
     "count": "100" 
    } 
] 
} 

請求2)

{ 
"handle": "iPad2", 
"inventory": [ 
    { 
     "outlet_name": "two", 
     "count": "200" 
    } 
    ] 
} 

因此,它會對每條記錄做出不同的請求,而不是將出口和計數分組在一起,並提出處理請求!

我知道使用它tAdvancedFileOutputXML我們可以用分組元素和循環產生嵌套sturcuture XML,但不知道怎麼做同樣的事情tXmlMap和tRESTClient ..

回答

0

你看到的選項「所有一個「在tXMLMap輸出上? 當您處於映射模式時,單擊輸出的扳手圖標並確保「All in One」設置爲true - 這似乎是將所有循環元素放入一個輸出行的訣竅。

+0

是的我也嘗試過,但實際上並沒有得到我想要的輸出該選項通過組合我的所有請求來創建單個請求,而不是僅爲映射請求組合「庫存」並創建多個請求。 – Vishnu