Julie Lerman's DevLife

DevLife Part I [May 2005 - March 2007]

My Links

Blog Stats

News

A blog for DevSource.com.

This blog was originally part of the blogs.ziffdavis.com site from May 2005 through June 2007 when the blog was moved to the Movable Type blog engine and hosted at blog.devsource.com/devlife.
The original blog was eventually shut down and I was given the posts so that I could host them on my own site.


Archives

Contract First vs Add Web Reference - the non-plumber view

In April I proclaimed that I was done with my training wheels (Visual Studio's Add Web Reference) and ready to start thinking and creating web services using the contract first approach.

"I think I have done more than enough with Web Services to finally get rid of the training wheels and prepare my head for Indigo", said I.

I went to TechEd 2005 in June and got my head filled with doing web services the contract first way from between listening to  Christian Weyer, attending a session by Tim Ewald and more. But then in late June I saw that the Visual Studio way of programming Indigo was still code first and this really confused me.

Tim Ewald spoke about web services this past Monday to the Vermont.NET user group that I run. Tim works for MindReef which produces SoapScope - a tool for analyzing and debugging web services. He told us that 80% of Mindreef's client's (I believe companies doing big enterprise apps) now write their web services starting with the contract.

Contract First seems to be the way that all of the people who are very knowledgeable about web services create them, yet there are only a handful of 3rd party tools that help us write them. One of the discussions that came up in the user group meeting was questioning why Microsoft doesn't have a tool for constructing web services this way.

With Indigo/WCF, Microsoft is strongly recommending that we write interfaces first and make those be the ServiceContracts, OperationContracts, etc. So, in a way, this is contract first even though it is done in OO code. Contract First means determine what the messages look like and what their rules are. Then the implementers (creator of web service or creator of client app) can implement however they like, just so long as the message is in compliance with the contract.

Many have looked at Indigo and said "gaaah! it's still RPC". But is it? I mean, it is  - it's interfaces and OO programming and we create services almost the same we do now in VS2003. But am I not creating a contract and  then implementing it in a separate service? Am I not letting my tool (Indigo) generate the WSDL?  There is no question that I will be using Visual Studio and Indigo together and follow the recommendations made by Microsoft and the plumbers like Michele Leroux Bustamante, who are smart enough to see where improvements can be made.

But I am *not* the person to look to when trying to compare the validity of WSDL created by Visual Studio vs. by something like thinktecture's WSCF tool. This seems to be a real sticking point with those who know web services at that level.

Here is a description of WSCF, by the way:

This new version 0.51 now offers a simple yet powerful WSDL Wizard that abstracts away all the nitty-gritty details of WSDL and therefore does not give room for making errors and wrong assumptions just by trying to use and applying everything that can be done stated by the original WSDL specification.

I learned to create web services the way most .net programmers did: write some .net code, stick some declarations in there ([WebService] or [WebMethod]) and then Add Web Reference from the client app. I didn't even know about web services until Microsoft released VS.NET and said ".NET is all about web services and here is how to create them." Do you remember that? That was before they said "oh and don't forget remoting" and before they said "Smart Client is everything" and before they said "it's all about messaging". (And one wonders why I'm dizzy...?) But I get frustrated when I hear the gurus scoffing at some of these tools and have to figure out where my sweet spot is in between these two places.

So I am still sorting it out. More importantly, I am using VS2005 and WCF and learning how things work. There is plenty to learn. I will keep my eye on what people like Christian and Michele are saying as they dig very deeply into WCF and continue to learn from them.

posted on Thursday, October 20, 2005 2:16 PM