Contract First Web Services with WCF

Christian Weyer has published a great article on the topic of Schema-based Development with Windows Communication Foundation. 

Few would argue with the value of Contract First programming when building large systems.  However when programming web services, the choice comes down to Code-based Contract First or Schema-based Contract First.

The WCF tools provide great support for the Code-based model – you define an interface using normal code constructs as you would for any .NET class or component, and then apply the ServiceModel attributes. Then the WCF plumbing automatically handles things like WSDL generation, and serialization issues.  For most developers this is a very convenient model.

However, there are reasons, especially when interoperability with other web service stacks is a priority, why many prefer the Schema-based model.  For them, the WSDL is the contract.  WCF does support this with tools like SvcUtil, but manipulating WSDL by hand can be a daunting task.

Christian has long been a proponent of Schema-based Contract First and has developed tools to plug into Visual Studio to better support this model.  In this article he explores the reasons you may want to consider the Schema-based approach, how WCF supports it, and how the latest version of the Web Service Contract First tool, WSCFBlue (a free tool hosted on CodePlex), makes it even easier.