|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Desperate please help with XmlSerializer, IXmlSerializable and XmlSchemaProviderI have a scenario where I need to send out my object schema in the WSDL. After hunting I found many posts (on MSDN and google) explaining that the way to do this is by using the poorly documented IXmlSerializable interface and the XmlSchemaProvider attribute. I've done this and it works great - my Schema now comes out correctly in the WSDL. Unfortunately, the side effect is that de/serialization no longer works. Why? Because I have to reimiplement the ReadXml() and WriteXml() methods manually. But I don't want to - I like the way the ..NET framework serizlizes and deserializes objects. I've seen the code in Reflector - it is HUGE. So how do I pass the power back to .NET to do the de/serialization? Though, as time has gone on I have discovered that no validation occurs and the only way to do this is to use the ReadXml() method to validate the incoming XML. So how do I do this (I guess with an XmlValidatingReader)? So two questions really: 1) How to hand back power to .NET for de/serizliation using the IXmlSerializable interface 2) How to do validation in the ReadXml method and then pass the responsibility back to .NET for deserialization. Please, please, please help me - I am at my whits end. |
|||||||||||||||||||||||