<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:insuranceauthorityResponse soapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://
DefaultNamespace">
<insuranceauthorityReturn xsi:type="ns2:Map" xmlns:ns2="http://
xml.apache.org/xml-soap">
<item xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<key xsi:type="soapenc:string">MC546717</key>
<value xsi:type="ns2:Map">
<item>
<key xsi:type="soapenc:string">FMCSAAPPLICANTID</key>
<value xsi:type="soapenc:string">460907</value>
</item>
<item>
<key xsi:type="soapenc:string">CENSUSCLASSDEF</key>
<value xsi:type="soapenc:string"></value>
</item>
</value>
</item>
</insuranceauthorityReturn>
</ns1:insuranceauthorityResponse>
</soapenv:Body>
</soapenv:Envelope>
Any ideas as to why this fails on a parse? Any help is appreciated!
> When I do receive the response, the XMLDOM object is throwing a
> parse error:
> Invalid at the top level of the document.
> I'm not sure what's going on since this is valid SOAP formatted XML.
caveat: SOAP isn't my cup of tea. :)
For anyone looking at this, here's what I've tried:
- loads fine into XML Notepad
- Views fine in IE 7, no idea which DOM model version it might be using.
:)
http://www.xml.com/2000/05/10/conformance/reports/msxml3-nv.html says
that this error occurs (successfully) in their testing for the following
reasons:
- Text may not appear after the root element.
- Character references may not appear after the root element.
- Provides #PCDATA text after the document element.
- Provides a CDATA section after the root element.
- CDATA is invalid at top level of document.
- Invalid character reference.
- Invalid placement of CDATA section.
- Invalid placement of entity declaration.
- Tags invalid within EntityDecl.
- Entity reference must be in content of element.
- Invalid placement of Parameter entity reference.
- Use of illegal character within XML document. (multiple tests)
- References aren't allowed in Misc, even if they would resolve to valid
Misc.
Maybe these will help. If you go to that site, you can look up the tests
and see what they actually are. :)
Lessee, what else can I find in this 15 minutes of break time....
From http://support.microsoft.com/default.aspx?scid=kb;EN-US;q251134 :
SYMPTOMS
When attempting to load an XML file saved as UTF-7 (a transfer encoding
format for Unicode), the XML parser in Internet Explorer generates the
following error message:
Invalid at the top level of the document.
The same error also occurs when using the MSXML parser from server-side
or client-side script.
Oh, look, hit #6, OP's message.... :)
http://msdn2.microsoft.com/en-us/library/ms762632.aspx has something
about a ProhibitDTD property, which is true by default now, wasn't in
past versions.. Setting this property to true will prohibit DTDs and
result in a parse error of "Invalid at the top level of the document"
(XML_E_INVALIDATROOTLEVEL, 0xE52D) whenever a DTD is included.
And that's the end of my break. :) Back to you, Cerebrus.
_____
Peter Smith
Anyway, that's again for the help!
Set xmldom = CreateObject("Microsoft.XMLDOM")
xmldom.setProperty "ProhibitDTD", True
This enables the XMLDom object for parsing SOAP. Thanks again for the
research!
> Fromhttp://support.microsoft.com/default.aspx?scid=kb;EN-US;q251134:
> SYMPTOMS
> When attempting to load an XML file saved as UTF-7 (a transfer encoding
> format for Unicode), the XML parser in Internet Explorer generates the
> following error message:
> Invalid at the top level of the document.
> The same error also occurs when using the MSXML parser from server-side
> or client-side script.
>
> Oh, look, hit #6, OP's message.... :)
>
> http://msdn2.microsoft.com/en-us/library/ms762632.aspxhas something