Hello friends,
Facing some problem with XML deserialisation. Please help:
1) I have a XSD file, which i convert into a CS file using XSD tool. Tried to use this CS file in my project to deserialize a XML file (generated from the same XSD file). By doing this, iam getting error like "Cannot convert to type CLASSNAME" [or] sometimes "Error in reading or type mismatch in xml (1234, 223) - some line number"
[Or] "There was an error reflecting type 'CLASSNAME'."
I Guess this happens due to any mismatch in mapping of different classes and objects to the provided XML file (input).
2) In our 2nd attempt we took the XML file, Created a XSD out of it using "Create Schema' of Visual Studio and used this XSD to auto generate the CS file.
If we use this new CS file and try to deserialize the same XML file, it works PERFECT.
NOTE: The XSD in previous method has "xsd:"tags whereas the XSD generated by Visual Studio in 2nd method has "xs:" tags. Will this create any difference when we auto generate a CS file out of these? AFAIK xsd or xs doesnt matter, they dont play any role.
Please suggest.
Thanks,
Dinesh