我正在尝试从来自SOAP API响应的JSON响应中提取PLSQL中的值,JSON响应:
{
"@xmlns:SOAP-ENV": "http://test",
"SOAP-ENV:Header": null,
"SOAP-ENV:Body": {
"ProcessShipmentReply": {
"@xmlns": "http://test.com/",
"HighestSeverity": "WARNING",
"Notifications": {
"Severity": "WARNING",
"Source": "ship",
"Code": "7033"
},
"TransactionDetail": {
"CustomerTransactionId": "12345655"
},
"Version": {
"ServiceId": "ship",
"Major": "28",
"Intermediate": "0",
"Minor": "0"
},
"JobId": "1231561",
"RequiredDetail": {
"UsDomestic": "false",
"CarrierCode": "test",
"MasterTrackingId": {
"TrackingIdType": "test",
"FormId": "0430",
"TrackingNumber": "456413421"
}
}
}
}
}
我尝试从json中提取值的PLSQL:
APEX_JSON.parse(RESP);
P_TRACK_NO := APEX_JSON.get_varchar2('SOAP-ENV:Body.ProcessShipmentReply.RequiredDetail.MasterTrackingId.TrackingNumber');
我已经为其他API响应做过很多次了,也对这个做过同样的事情,但是我认为由于SOAP API响应,我无法得到与其他API相同的结果。请给我建议,我如何从这个JSON响应中提取值。
1条答案
按热度按时间bgibtngc1#
我猜想json键“SOAP-ENV:Body”中的“:“会将其丢弃,因此最好将其包含在双引号中: