It is well-known how to create a "contract first" WCF service where the first step is to define the ServiceContract
s and DataContract
s.
How should one approach WCF development if one has the "schema first". In other words, an XSD schema has been independently developed. The service may not deviate from the schema that is already defined. As a complication, the schema might use features that don't translate into DataContract
(the DataContract
capabilities, after all, are quite minimal).
Using XDocument
on the server or client side for the entire document would be fine and good. (Use of XDocument
would be greatly preferred over anything involving the XmlSerializer
which unfortunately seems to have fallen out of favor without replacement). It is a requirement that the metadata/WSDL properly report the actual schema per the standards. It may not report a "generic" schema such as xsd:any. (Figuring out how to deal with these WSDL requirements is the part that is giving me the most trouble.)
(Similar questions/answers here do not address XDocument
or WSDL requirements.)