Desperate please help with XmlSerializer, IXmlSerializable and XmlSchemaProvider

P

peter.moss

Please, please help me - I am desperate.

I 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top