業務需求
1、從數據庫中讀取表內容作爲入參;
2、根據入參讀取http接口並獲取返回數據;
3、解析返回的json並提取其中的xml字段;
4、解析該xml字段;
5、入庫。
使用組件
表輸入用於讀取數據庫內容、rest client用於發送http請求並接受返回數據、json input用於接收返回數據並解析、Get data from XML用於解析XML
數據結構
入參爲姓名、身份證號,直接數據庫中讀取並拼接
獲取到入參後,即可設置rest請求
返回結果爲json對象,內部字段包含xml字符串
{"entity":"
<FamilyInfo>
<info>
<code>35000xxxxxxxx</code>
<name>張三</name>
<tel>137000000</tel>
<relation>兒媳</relation>
</info>
<info>
<code>350103xxxxxxxxxx</code>
<name>王五</name>
<tel></tel>
<relation>兒子</relation>
</info>
</FamilyInfo>","errorcode":"00","message":"調用服務成功","success":true,"type":"0"}
接下來對實體進行提取操作
隨後進行xml解析併入庫
總體一覽