As always, there is something I need from time to time, but not frequently enough to have it close to me, so I have to search for it from time to time. I mean OK, bing is good, but still it takes some time, so I’m publishing this as a note to myself and maybe the others. One of such problems – to generate single WSDL file for WCF service. Mainly this is required if you have some interoperability issues.
Ok, so to have the single WSDL right way you need following things (assuming you’re hosting WCF in IIS):
- Create custom service host (see here: http://blogs.msdn.com/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx)
- Apply the namespace attribute to the ServiceBehavior attribute
- Add bindingNamespace to the endpoint element in your web.config (Credit goes to: http://isinghblog.blogspot.com/2009/03/wcf-service-and-adobe-livecycle_10.html)
So, its fairly easy to achieve in the end. And if you think what is else possible to do with custom behaviors, service hosts, etc. – you will realize how much WCF is rock’n’roll.