Can anyone spot where I have gone wrong,
vb.net code;
Dim responseDoc As New Xml.XmlDocument
responseDoc.LoadXml(response)
Debug.Print(responseDoc.SelectSingleNode("aggregateQuoteResponse/brokerResponse/quote/premium").InnerText)
Issue:
the above line ALWAYS errors with the following error ; object reference not set to an instance of an object
the XML is below, i have done this dozens of times before so it must be me missing the obvious;
XML:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns:aggregateQuoteResponse xmlns:ns="
<transactionID>5aa0c2aec0c14a6d:-13bcb51e:12afbc91fdb:-7f52.Mon Sep 20 16:52:11 BST 2010</transactionID>
- <brokerResponse xmlns:xsi="
<brokerRef>Onequote</brokerRef>
<webReference>67F-2HC-D48</webReference>
- <quote xsi:type="ns:aggregateQuoteResultTypeCaravan">
<premium>18830</premium>
<ipt>990</ipt>
<iptRate>5.0</iptRate>
<insurerCode>DW</insurerCode>
<insurerName>Drewe</insurerName>
<schemeCode>DO</schemeCode>
<reason>Total Premium (Excl IPT).........(#)</reason>
<totalSumInsured>900000</totalSumInsured>
<caravanSumInsured>400000</caravanSumInsured>
<equipmentSumInsured>200000</equipmentSumInsured>
<contentsSumInsured>300000</contentsSumInsured>
</quote>
</brokerResponse>
</ns:aggregateQuoteResponse>
vb.net code;
Dim responseDoc As New Xml.XmlDocument
responseDoc.LoadXml(response)
Debug.Print(responseDoc.SelectSingleNode("aggregateQuoteResponse/brokerResponse/quote/premium").InnerText)
Issue:
the above line ALWAYS errors with the following error ; object reference not set to an instance of an object
the XML is below, i have done this dozens of times before so it must be me missing the obvious;
XML:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns:aggregateQuoteResponse xmlns:ns="
<transactionID>5aa0c2aec0c14a6d:-13bcb51e:12afbc91fdb:-7f52.Mon Sep 20 16:52:11 BST 2010</transactionID>
- <brokerResponse xmlns:xsi="
<brokerRef>Onequote</brokerRef>
<webReference>67F-2HC-D48</webReference>
- <quote xsi:type="ns:aggregateQuoteResultTypeCaravan">
<premium>18830</premium>
<ipt>990</ipt>
<iptRate>5.0</iptRate>
<insurerCode>DW</insurerCode>
<insurerName>Drewe</insurerName>
<schemeCode>DO</schemeCode>
<reason>Total Premium (Excl IPT).........(#)</reason>
<totalSumInsured>900000</totalSumInsured>
<caravanSumInsured>400000</caravanSumInsured>
<equipmentSumInsured>200000</equipmentSumInsured>
<contentsSumInsured>300000</contentsSumInsured>
</quote>
</brokerResponse>
</ns:aggregateQuoteResponse>