This post originated from an RSS feed registered with .NET Buzz
by Christian Weyer.
Original Post: Demoing "contract first" approach with WSDL Designer
Feed Title: Christian Weyer: Web Services & .NET
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/cweyer/Rss.aspx
Feed Description: Philosophizing about and criticizing the brave new world ...
OK, this was the first time I showed thisinterestingapproach to the public. I have been thinking, reading, writing and talking about it for quite a long time now. But yesterday was the first presentation where I actually showed it to the audience.
And I can tell you: most of them totally understood why the "contract first" approach seems so much more natural than the currently hyped and propagated "code first" approach (but I know there are other opinions). Well, both views and techniques are absolutely valid, no discussion at all here. I just wanted to let the people know that when talking about and thinking of SOA and Web services we should essentially be thinking about about interfaces, contracts and policies - and about exchanging messages. That's all! Well, 'my' approach to WSDL design is at least one part of this process.
Here we go with a sample I showed at the FHSO Web services-Tagung in Olten, Switzerland. I used the Omniopera WSDL and Schema Editor tool from Kamiak. I do like, but not love it. Its user expereience is just too bad and it simply does not behave as a new and modern Windows application should behave - that's sad. But anyway, the following is a screenshot (click to enlarge) of the 'types' or XML Schema structs I designed beforehand. The sample is a simple AddressManager Web service to manage addresses of persons. I have structures for Address, AddressType and Person.
As you can see with the Address schema I just played around with it to show the audience the Open Content Model which can be used to obtain a type evolvability or better yet to make Web services messages more flexible and resilient to changes. This very schema was then used to design the Web services technical contract based on WSDL with the same tool. The following figure (click to enlarge) shows the complete WSDL in the designer view.
The last step was to use the wsdl.exe command line utility from the .NET Framework SDK to generate a client side proxy and a server side stub class (with the /server switch). That's it! First design your metadata and your contract and let a tool (either .NET's wsdl.exe or e.g. Java's wsdl2java) generate the core code skeleton. And always think about the applicable design methods for resilient messages ... Yasser, my friend, I hope you read this entry about an approach you surely like and come back to the blogging world soon. PDC is just a few days ahead ;-)
And to say the least: I hope to meet one or the other MS guy at PDC in L.A. who is responsible for the design tools in Whidbey or later. We definitely need a 'Web services designer' on this level in Visual Studio .NET.
Note to self: Implement a VS.NET add-in which takes in a WSDL and generates client side proxy and server side stub code - a lot of developers do not want to leave the IDE for those simple tasks.