I have written a client to a public SOAP web service, using a WSDL and several XSD files supplied by the service provider. I wanted to find an easy way to validate user data against the XSD files, so I used the standard example from MSDN, using an XmlSchemaSet for the XSD files, an XmlReader and a validation routine to catch the error messages. (The code is available at http://msdn.microsoft.com/en-us/library/as3tta56.aspx) It works for some data elements, but others do not throw an error when they are invalid. If I include "ValidationFlags = ValidationFlags Or XmlSchemaValidationFlags.ReportValidationWarnings", I then get a lot of warnings, e.g. "Could not find schema information for the element 'MyRequest'", "Could not find schema information for the attribute 'TheDate'", etc. But I can open the XSD files in the VS2010 IDE, and its XML Schema Explorer shows these elements and attributes.
So my main question to anyone who is familiar with validating XML data in VS2010 in this way is, are there limits to the complexity of the XSD files that the XmlReader validation can handle? Could the prefixes for the Target Namespaces confuse the XmlReader? There are thousands of complex types defined in the schema, spread across 7 XSD files, which is why I wanted this to be handled automatically, rather than me writing a validation routine for each user input field.
Thanks in advance.