I think the answer of the endpoint is not fully loaded by objXML.loadXML, so there is an error “problem with DTD”
I try to read an api. it works fine with postman, header and XML looks ok
But if I try to call this endpoint with VBA (with ms-access 2016) like this, there are problems
Set objXML = New MSXML2.DOMDocument
XMLRequest.Open "GET", URL, False
XMLRequest.send "apiKey=" & apiKey
Dim x
x = XMLRequest.responseXML.XML
debug.print x
If Not objXML.loadXML(XMLRequest.responseXML.XML) Then
Debug.Print objXML.parseError.reason
End If
- i see the start of the xml file when hoovering over x “…
- debug.print x show a part of the file only: the end
- and objXML.loadXML fails with parseError.reason like “problems with DTD” and names two fields
I don’t think that the xml is corrupt. I don’t find a problem with the mentioned fields. I think it may be because the xml is not loaded fully like “x” is not shown fully. So then not all infos of the DTD could be found.
Does anyone has any idea what goes wrong here ?