I'm trying to parse a response from another system that is in XML. I decided to use RapidXML as my parser. Everything was going fine until the system reported a "faultResponse" message. When trying to handle the "faultResponse" message I get a parse error
I made sure I'm capturing the exception code and it says it's a parse error. "Expected <". I'm looking at the sending system and they log what they send, so I know it's not missing an <. I tried xmllint to verify it's a good file and xmllint says it's good
Actual XML being sent from remote system
<FaultResponse sequenceNumber="10004993">
<Exception type="System.Exception">
<message>Distribution Exception: </message>
<detail>System.Exception: Distribution Exception: ---> System.Exception: Error copying "AcomSubscriber.xds" to "\\ACOM-P40\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P42\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P39\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P41\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P44\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P43\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P47\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P49\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P45\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P48\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P50\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P46\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P51\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
--- End of inner exception stack trace ---</detail>
<Exception type="System.Exception">
<message>Error copying "AcomSubscriber.xds" to "\\ACOM-P40\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P42\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P39\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P41\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P44\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P43\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P47\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P49\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P45\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P48\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P50\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P46\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P51\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password</message>
<detail>System.Exception: Error copying "AcomSubscriber.xds" to "\\ACOM-P40\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P42\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P39\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P41\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P44\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P43\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P47\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P49\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P45\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P48\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P50\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P46\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password
Error copying "AcomSubscriber.xds" to "\\ACOM-P51\C$\Program files (x86)\Zetron\AcomConsole"; Exception: Logon failure: unknown user name or bad password</detail>
</Exception>
</Exception>
</FaultResponse>
// get message from system and store in variable target
rapidxml::xml_document<> doc;
try
{
doc.parse<0>(target);
}
catch (const std::runtime_error& e)
{
std::cerr << "Runtime error was: " << e.what() << std::endl;
}
catch (const rapidxml::parse_error& e)
{
std::cerr << "Parse error was: " << e.what() << std::endl;
cout << "Trying to parse: " << target << " of size " << strlen(target) << endl;
}
catch (const std::exception& e)
{
std::cerr << "Error was: " << e.what() << std::endl;
}
catch (...)
{
std::cerr << "An unknown error occurred." << std::endl;
}
I expected to get the doc variable to have the contents of the xml document and start working my way through it, but I get the parse error.