Posts
76
Comments
6720
Trackbacks
7
December 2006 Entries
WCF and WSDL Description

Just like ASP.Net 2.0 Windows Communication Foundation (WCF) uses Web Service Description Language (WSDL 1.1 - http://www.w3.org/TR/wsdl) to describe services.  One item that seems overlooked in WCF is the Description property from an attribute on a Web Service or Web Method.

In ASP.Net 2.0, you can easily add a description to a Web Service or Web Method using an attribute above the class or method.  See example below.

[System.Web.Services.WebService(
Namespace="http://servername/xmlwebservices/",
Description="Some descriptive text could go here.")]
public class Service1 : System.Web.Services.WebService
{
// Implementation code.
}
 

Out of the box, WCF doesn't support a description property for Web Service (Service Contract) or Web Method (Operation Contract).  Instead, you must extend WCF to support this capability.  Fortunalty, WCF is extremely extensible and below is a list of potential solutions:

Custom WSDL Publication - http://msdn2.microsoft.com/en-gb/library/aa717040.aspx
WSDL Documentation Sample - http://wcf.netfx3.com/files/folders/service_contract_snippets/entry4538.aspx

posted @ Wednesday, December 27, 2006 4:18 AM | Feedback (77)