Retrieve data from complex XML file

Hi 

I am new to XML and was wondering if you could assist in advising how to retrieve data such as account number, carrier name and pricing from the following webservice response XML structure to populate a Business Central table.

<GetDeliveryOptionsResult><deliveryoptionresults>
<recommended><DeliveryOption><accno>123456</accno><carriername>TEST CARRIER1</carriername><carrzone>ZONE 1</carrzone><condate>1/04/2021</condate><datelong>20210401</datelong><fromzone>ZONE 1</fromzone><optionid>NDozOjEwOi0xOjMy</optionid><primarypricing>65.90</primarypricing><secondarypricing>13.18</secondarypricing><service>NEXT DAY</service></DeliveryOption>
</recommended>
<otheroptions>
<DeliveryOption><accno>789456</accno><carriername>TEST CARRIER2</carriername><carrzone>ZONE 1</carrzone><condate>1/04/2021</condate><datelong>20210401</datelong><fromzone>ZONE 1</fromzone><optionid>NTozOjEzOi0xOjMy</optionid><primarypricing>69.00</primarypricing><secondarypricing>13.80</secondarypricing><service>NEXT DAY</service></DeliveryOption>
<DeliveryOption><accno>565656</accno><carriername>TEST CARRIER3</carriername><carrzone>ZONE 1</carrzone><condate>1/04/2021</condate><datelong>20210401</datelong><fromzone>ZONE 1</fromzone><optionid>NjozOjc6LTE6MzI=</optionid><primarypricing>72.50</primarypricing><secondarypricing>14.50</secondarypricing><service>NEXT DAY</service></DeliveryOption>
</otheroptions>
<distance></distance>
<istopobox>False</istopobox>
<selectedtype>cost</selectedtype>
<updates><ObjectUiFormContents><_nonratingzonesdone>-196865584</_nonratingzonesdone></ObjectUiFormContents>
</updates>
</deliveryoptionresults>
</GetDeliveryOptionsResult>

I am struggling to get my head around XMLNode Lists, XML Nodes and XML Elements.  Any advice on how to loop through this structure would be much appreciated.  

Regards

Gurnek

Parents Reply Children
No Data
Related
Recommended