in

Drowning In Technical Debt

C# | ASP.NET | SharePoint | SQL | Architecture | SOA |

David Strommer

December 2006 - Posts

  • 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

Powered by Community Server (Commercial Edition), by Telligent Systems