For an asmx w开发者_C百科ebservice ServiceDescriptionReflector can be used to generate a schema programmatically for message validation.
Is their a WCF equivalent for runtime schema generation?
If you want to customize the WSDL generation process, implement a Contract or Endpoint behavior and inject a custom IWsdlExportExtension implementation.
Here's an older sample I wrote on that a few years ago.
精彩评论