4

I tried to execute the following lines

VARIANT_BOOL vBoolTestConnection;

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

bstrInput has the following XML specifications. loadXML is returning false for the XML specified. bstrInput has '@' in the password tag. If I replace the @ symbol with anyother password characters, Load XML is working fine. Could you please help me to find the 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>"
Prabhu
  • 723
  • 2
  • 10
  • 29

1 Answers1

2

BSTR is usually UTF-16. The XML string that you posted claims that it's using encoding UTF-8.

Harvey Kwok
  • 11,713
  • 6
  • 37
  • 59