2
我是新來的騾esb。我正在嘗試從mySQL獲取值並將其轉換爲XML。然後點擊服務,然後結果將被存回數據庫表。我有兩個問題ESB騾 - 數據編織器轉換
1)我可以看到兩種不同的ESB騾子映射方式。 a)使用「數據映射器」 b)使用「變換消息」 - 這將使用數據Weaver。 哪一種轉換方法適合我的要求。
2)我嘗試使用「變換消息」和數據編織器進行轉換。 我的數據庫輸入將獲取三行,如下所示。
college = abc college = abc college = abc
dept = IT dept = CSE dept = MECH
No of students = 5 No of students = 4 No of students = 7
預計產量
<University>
<college>abc</college> <!-- this is simple tag/ It will not repeat -->
<dept> <!-- This is complex tag -->
<dept Name>IT</dept Name>
<No of students>5</No of students>
</dept>
<dept>
<dept Name>IT</dept Name>
<No of students>5</No of students>
</dept>
<dept>
<dept Name>IT</dept Name>
<No of students>5</No of students>
</dept>
我試過數據韋弗類似下面。
%dw 1.0
%output application/xml
"University":{
"college": payload.college,
dept: {
dept_Name: payload."dept_Name",
No of students: payload."No of students"
}
}
但是上面的dw沒有給出預期的結果。你能幫我解決這個問題嗎?
非常感謝。它爲我工作。 :) – Simbu