【发布时间】:2020-07-01 23:48:29
【问题描述】:
我从fedex webservices 得到这个xml 响应,看起来像:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<TrackReply xmlns="http://fedex.com/ws/track/v18">
<HighestSeverity>SUCCESS</HighestSeverity>
<CompletedTrackDetails>
<Notifications>
<Severity>SUCCESS</Severity>
<Source>trck</Source>
<Code>0</Code>
<Message>Request was successfully processed.</Message>
<LocalizedMessage>Request was successfully processed.</LocalizedMessage>
</Notifications>
<DuplicateWaybill>false</DuplicateWaybill>
<MoreData>false</MoreData>
<TrackDetailsCount>0</TrackDetailsCount>
<TrackDetails>
*<StatusDetail>
<CreationTime>2020-06-24T00:00:00</CreationTime>
**<Code>DL</Code>**
<Description>Delivered</Description>
<Location>
<City>New York</City>
<StateOrProvinceCode>New York</StateOrProvinceCode>
<CountryCode>US</CountryCode>
<CountryName>United States</CountryName>
<Residential>false</Residential>
</Location>
</StatusDetail>*
<CarrierCode>FDXE</CarrierCode>
</TrackDetails>
</CompletedTrackDetails>
</TrackReply>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我想存储 StatusDetail 中的信息并对其进行处理,特别是 Code 中存储的信息 -> DL
任何帮助将不胜感激。
【问题讨论】:
标签: xml kotlin xml-parsing wsdl fedex