I'm currently developing a message framework with XML handling in C++, using MSXML2 and DOM. However, I'm not sure how I can validate SOAP messages with MSXML2. My problem is:
To add a schema into the schema cache before validating xml instances, I use the method
pSchemaCache->add(nspace, filePath);
But I have no file path to the SOAP definitions, and for me it seems that the cache does not comprise this definition by default. When trying to validate my SOAP message with the method
pXMLDoc->loadXML(soapString);
it returns the error "Validate failed because the document does not contain exactly one root node". This is the case even with this message:
< xml version="1.0" encoding="utf-8" > <soap:Envelope xmlns:soap=" http://www.hide-link.com/ "> <soap:Header> <context:ContextHeader xmlns:context="contextHeader.xsd"> <sender>GBA</sender> <date>26/04/2006 18:41:00</date> <operation>handlers</operation> </context:ContextHeader> </soap:Header> <soap:Body> </soap:Body> </soap:Envelope>
Can somebody help me
.NET Development4
|