Main Page

  Previous Section Next Section

Chapter 32. The System.Web.Services.Description Namespace

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 particular portion of a WSDL document, and you do not provide any additional functionality.

All details of WSDL implementation are "abstracted away" from you when creating or consuming a web service with .NET. For that reason, you may have little need to use the types in this namespace. To learn more about the specifics of the WSDL standard on which these types are based, refer to http://www.w3.org/TR/wsdl. Figure 32-1 shows ServiceDescriptionFormatExtension-derived types, and Figure 32-2 shows other types. Figure 32-3 contains the collections in this namespace.

Figure 32-1. ServiceDescriptionFormatExtension-derived types
Figure 32-2. More types from the System.Web.Services.Description namespace
Figure 32-3. Collection classes
      Previous Section Next Section