我有一個JSON響應,我想迭代並將事件
數值,經度,緯度作爲一個組捕獲,並將其發送到SMS消息服務。我試過 不同的方法,但我無法獲得這些元素。我試圖調試並使用
不同的表達式,沒有任何運氣。建議表示讚賞。在Mulesoft中迭代JSON列表
[
{
"type": " --T::00"
},
{
"address": "2720 E Madison St",
"longitude": "-122.296667",
"latitude": "47.623153",
"incident_number": "F110104004",
"type": "Medic Response",
"report_location": {
"needs_recoding": false,
"longitude": "-122.296667",
"latitude": "47.623153"
}
},
{
"address": "2260 1st Av S",
"longitude": "-122.334199",
"latitude": "47.583347",
"incident_number": "F110103709",
"type": "Aid Response",
"report_location": {
"needs_recoding": false,
"longitude": "-122.334199",
"latitude": "47.583347"
}
},
{
"address": "1930 Boren Av",
"longitude": "-122.333103",
"latitude": "47.617173",
"incident_number": "F110103707",
"type": "Aid Response",
"report_location": {
"needs_recoding": false,
"longitude": "-122.333103",
"latitude": "47.617173"
}
]
這裏是配置文件。
<flow name="seattleemergencyFlow1" doc:name="seattleemergencyFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8900" path="get-emergency" doc:name="HTTP"/>
<http:outbound-endpoint exchange-pattern="request-response" host="data.seattle.gov" port="80" path="resource/kzjm-xkqj.json?" method="GET" contentType="application/json" doc:name="HTTP"/>
<json:json-to-object-transformer doc:name="JSON to Object" returnClass="java.util.List"/>
</flow>