I'm working on a .NET project that integrates with an external company. This company will be sending us XML messages via HTTP POST (raw XML, not SOAP). There are basically three different types of XML messages they will be sending us, which all have their own XSDs. There is no inheritance hierarchy between these XSDs, they are all basically standalone XML "entities."
Right now, we are just using an IHttpHandler .ashx class to process the XML. We created a class from each XSD, and are using XmlSerializer to convert the different XML messages to objects. This is not ideal, because we need to know the type of message before creating the appropriate XmlSerializer to process it. We are currently just looking at the root element name in the message to choose which type to pass to the XmlSerializer.
There has to be a better way to do this... Is there something in WCF that can do this automatically with plain XML? Or is there an XML serializer available that can dynamically serialize multiple types? Any other suggestions?