I have an XML API response which I am trying to parse in VBA. I am trying to use
objXML.selectNodes("//soap:Envelope/soap:Body/ConsignmentTrackingGetFullDetailsV3Response/ConsignmentTrackingGetFullDetailsV3Result/FullConsignmentDetails/ConsignmentStatuses")
but this doesn't appear to find any nodes.
I have also looked at the objXML.getElementsByTagName but this doesn't work either
I am able to access these nodes by using a number of childnodes but this doesn't seem very efficient. I am new to SOAP but have tried to add namespaces.
The XML response is below.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ConsignmentTrackingGetFullDetailsV3Response xmlns="http://webapp-cl.internet-delivery.com/ThirdPartyIntegrationService">
<ConsignmentTrackingGetFullDetailsV3Result>
<ResultState>Successful</ResultState>
<FullConsignmentDetails>
<ConsignmentNumber>31487490001622</ConsignmentNumber>
<ConsignmentStatuses>
<GetConsignmentDetailsStatus>
<StatusCode>2</StatusCode>
<StatusDescription>Collected</StatusDescription>
</GetConsignmentDetailsStatus>
<GetConsignmentDetailsStatus>
<StatusCode>4</StatusCode>
<StatusDescription>Out For Delivery</StatusDescription>
</GetConsignmentDetailsStatus>
</ConsignmentStatuses>
</FullConsignmentDetails>
</ConsignmentTrackingGetFullDetailsV3Result>
</ConsignmentTrackingGetFullDetailsV3Response>
</soap:Body>
</soap:Envelope>
Any suggestions on how to efficiently parse the required nodes would be appreciated.