
Generate Web Services Code #99
Chapter 13, Enhancing Visual Studio
|
441
HACK
always a good thing, since Visual Studio assumes an XML-based RPC view
of Web Services.
There is an idea in Web Services development called contract-first or con-
tract-driven development. The basic idea is that, instead of letting Visual
Studio generate a WSDL file for you, you should write this WSDL file by
hand using a WSDL, XML, or text editor.
WSDL stands for Web Services Description Language. It is
an XML format used to describe a Web Service’s interface by
defining its operations and message exchange patterns. The
actual messages are defined using a schema definition lan-
guage like XSD.
Why would you want to write something by hand that Visual Studio will
usually generate for you? Letting Visual Studio generate your WSDL is kind
of like picking up a car on the lot and then letting the dealer take care of the
contract for you. Sure, you get the car—but who knows what you are com-
mitted to. By writing your WSDL first, you have complete control over how
your Web Service will be seen to the outside world, including its interface
and data structures. This is really just a continuation of the idea of contract-
driven development that has been around for years—the idea of first creat-
ing a contract that your object will implement and that your clients will con-
sume.
Writing the WSDL to your Web Services can be a task in