Contract First Web Service Development

Thursday, November 18, 2004 12:00:00 AM (Central Standard Time, UTC-06:00)
I have a heard a lot of buzz about contract first development as of late.  I first heard about it from Ed Ferron and Matt Milner after they returned from their PluralSight training in the beginning of November.
 
Aaron Skonnard and Don Box have brought it up in their blogs.
 
I Googled it and found a reference to it on MSDN that was published late October.  It that was co-authored by James Duff, Eric Cherng both of Vertigo Software (the folks that brought us PetShop) and Dino Chiesa of Microsoft.
 
The concept of Contract First development comes down to taking more control over how the .NET Framework handles the creation of your web service contract (WSDL) that clients consume.  If you don't need the control, then you don't need to take on the additional complexity of hand modifying your WSDL.  As many have mentioned, the tool sets for creating WSDL are not there yet.
 
So when do you need that control?  Interop with other platforms seems to be the most popular instance, as the fidelity of data types my not translate well into other platforms.  By taking control of the contract, you can describe in more detail how to represent a type that may not have a direct equivalent in another platform. 
 
Another instance is working in BizTalk, which requires the schema of messages to be defined first.  I just finished a SOA project that included BizTalk as a component of the implementation.  We did a type of Contract First development, but not exactly the way it is described in the MSDN article.  We designed the way we wanted our messages to look by laying them out in xml.  Then converted them to a type, and from the type created our schemas which then was consumed by BizTalk and our web services.  The MSDN article suggests having the Xml Web Services framework  generate the wsdl for you, then modify the wsdl to meet the needs of interop and generate the types from that.
 
One of the things we really struggled with was getting the xsd.exe to produce the class structures we wanted.  We ended up abandoning the tool pretty early, looked at alternatives (Dingo, XsdTidy, SchemaTron, and modifying the xsd.exe source), but ended up writing an implementation that would take an xml document and create the class structure, gets/sets for properties and strongly typed collections we were looking for.
 
The folks at thinktecure have created an IDE add-in (WsContractFirst) that takes a wsdl and creates the proxy and server side classes based on your modified wsdl contract.
Friday, November 11, 2005 11:27:41 PM (Central Standard Time, UTC-06:00)
Dear Shannon
Could you please release the code for generating the .net code based on an XML document that you mention here.
The same would help many programmers like me who are unhappy with xsd tool of Microsoft.

Thanks and regards
Rohit
Comments are closed.