简体   繁体   中英

Error when load xml in a XmlDocument used the method xmlLoad in vb.net

This is my code:

XmlDocument soapEnvelopeXML = new XmlDocument();
soapEnvelopeXML.LoadXML(xml);

The variable string is as follows below. But when execute code gives erro: XmlException was caught: Error while parsing EntityName. Line 1, position 1439.

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:QCI-INTERFACENET="http://qci.querycommerce.com:60801/interfacenet/">
    <SOAP-ENV:Header>
        <QCI-INTERFACENET:authentication>
            <QCI-INTERFACENET:user>pu</QCI-INTERFACENET:user>
            <QCI-INTERFACENET:password>p[u:4)yw</QCI-INTERFACENET:password>
        </QCI-INTERFACENET:authentication>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <QCI-INTERFACENET:erpToQciProduct>
            <QCI-INTERFACENET:products>
                <QCI-INTERFACENET:list>
                    <QCI-INTERFACENET:item>
                        <QCI-INTERFACENET:product_id>000204001</QCI-INTERFACENET:product_id>
                        <QCI-INTERFACENET:active>1</QCI-INTERFACENET:active>
                        <QCI-INTERFACENET:allow_integration>1</QCI-INTERFACENET:allow_integration>
                        <QCI-INTERFACENET:barcode>000204001</QCI-INTERFACENET:barcode>
                        <QCI-INTERFACENET:reference>000204</QCI-INTERFACENET:reference>
                        <QCI-INTERFACENET:name>APONTADOR CIS - ELETRICO - AP-EL</QCI-INTERFACENET:name>
                        <QCI-INTERFACENET:description></QCI-INTERFACENET:description>
                        <QCI-INTERFACENET:short_description></QCI-INTERFACENET:short_description>
                        <QCI-INTERFACENET:annotation></QCI-INTERFACENET:annotation>
                        <QCI-INTERFACENET:price>269</QCI-INTERFACENET:price>
                        <QCI-INTERFACENET:special_price></QCI-INTERFACENET:special_price>
                        <QCI-INTERFACENET:manufacturer>COMÉRCIO E IMPORTAÇÃO SERTIC LTDA</QCI-INTERFACENET:manufacturer>
                        <QCI-INTERFACENET:brand></QCI-INTERFACENET:brand>
                        <QCI-INTERFACENET:model>ELETRICO - AP-EL</QCI-INTERFACENET:model>
                        <QCI-INTERFACENET:line>ESCRITA & CORRETIVOS</QCI-INTERFACENET:line>
                        <QCI-INTERFACENET:color>-</QCI-INTERFACENET:color>
                        <QCI-INTERFACENET:collection>-</QCI-INTERFACENET:collection>
                        <QCI-INTERFACENET:department></QCI-INTERFACENET:department>
                        <QCI-INTERFACENET:gross_weight>0</QCI-INTERFACENET:gross_weight>
                        <QCI-INTERFACENET:net_weight>0</QCI-INTERFACENET:net_weight>
                        <QCI-INTERFACENET:group>APONTADORES</QCI-INTERFACENET:group>
                        <QCI-INTERFACENET:height></QCI-INTERFACENET:height>
                        <QCI-INTERFACENET:width></QCI-INTERFACENET:width>
                        <QCI-INTERFACENET:length></QCI-INTERFACENET:length>
                        <QCI-INTERFACENET:size>-</QCI-INTERFACENET:size>
                    </QCI-INTERFACENET:item>                        
                </QCI-INTERFACENET:list>
            </QCI-INTERFACENET:products>
        </QCI-INTERFACENET:erpToQciProduct>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I can not run the code it gives error in xmlLoad method.

转义“&”字符:

<QCI-INTERFACENET:line>ESCRITA &amp; CORRETIVOS</QCI-INTERFACENET:line>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM