Best way to document WCF interface? [closed] Best way to document WCF interface? [closed] xml xml

Best way to document WCF interface? [closed]


We use WCFExtras (http://www.codeplex.com/WCFExtras) for that.

Among other features it allows live exporting of your code xml comments into the generated WSDL, for example check how these xml comments:

    /// <summary>    /// Retrieve the tickets information for the specified order    /// </summary>    /// <param name="orderId">Order ID</param>    /// <returns>Tickets data</returns>    [OperationContract]    TicketsDto GetTickets(int orderId);

get reflected in the WSDL of that interface:

    <wsdl:operation name="GetTickets">    <wsdl:documentation>    <summary> Retrieve the tickets information for the specified order </summary> <param name="orderId">Order ID</param> <returns>Tickets data</returns>    </wsdl:documentation>    <wsdl:input wsaw:Action="xxxx" message="tns:PartnerAPI_GetTickets_InputMessage"/>    <wsdl:output wsaw:Action="xxxx" message="tns:PartnerAPI_GetTickets_OutputMessage"/>    </wsdl:operation>

An excerpt from their docs:

Adding WSDL Documentation from Source Code XML CommentsThis extension allows you to add WSDL documentation (annotaiton) directly from XML comments in your source file. These comments will be published as part of the WSDL and are available for WSDL tools that know how to take advantage of them (e.g. Apache Axis wsdl2java and others). Release 2.0 also includes a client side WSDL importer that will turn those WSDL comments to XML comments in the generated proxy code.


Do use XML docs for that. There are a lot of smart meta-tags that will allow you to put code samples in them, references between operations, thrown exceptions etc.

Then you can use Sandcastle (+ some GUI you can find on Codeplex) to generate either chm, or html documentation.


I use two XSL files - one to document the WSDL for the operations, one to document the XSD for the data being passed around.

Unfortunately, so far, I haven't found a single cohesive solution, so I work with two XSLT files which transform the WSDL and the XSD respectively into HTML documentation.

WSDL Viewer does the job for the WSDL and produces a first HTML document, and xs3p does the same for the data contain in the XSD file.