Failed to load '@' character with loadxml

I tried to execute the following lines

VARIANT_BOOL vBoolTestConnection; vBoolTestConnection=m_spXMLDom->loadXML(bstrInput.m_str); 

bstrInput has the following XML specifications. loadXML returns false for the specified XML. bstrInput has a "@" in the password tag. If I replace the @ character with any other password characters, Load XML works fine. Could you help me find a solution?

 "<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP- ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP- ENV:Body><CheckValidUser xmlns="http://systemsys"><UserName>HGDXJHSAD</UserName><Password>&</Password></CheckValidUs er></SOAP-ENV:Body></SOAP-ENV:Envelope>" 
+4
source share
1 answer

BSTR is usually UTF-16. The XML string you posted claims to use UTF-8 encoding.

+2
source

All Articles