Chapter 30. The System.Web.Services.DescriptionNamespace

The System.Web.Services.Description namespace includes types used to represent the elements of Web Service Description Language (WSDL), an XML grammar that describes web services and specifies how to interact with them. Web services created with ASP.NET automatically generate their own WSDL documents, which contain all the information a client needs to interact with them and invoke their methods. You can retrieve this document by requesting the appropriate .asmx file with ?WSDL appended to the end of the URL (as in http://www.mysite.com/myservice.asmx?WSDL).

The starting point for understanding this namespace is the ServiceDescription class, which represents the complete WSDL document and provides collections of Binding, Message, Types, and Service objects. The ServiceDescription class also provides Read() and Write() methods, which allow you to convert between actual WSDL documents and their object representation. Finally, you can also use the ServiceDescriptionReflector class to create a ServiceDescription object based on an existing web service by supplying the web service’s URL.

Another interesting class in this namespace is ServiceDescriptionImporter, which provides the functionality .NET uses to create proxy classes based on WSDL documents. Most other classes represent a paticular portion of a WSDL document, and you do not provide any additional functionality.

All details of WSDL implementation are “abstracted away” ...

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.