This project has moved. For the latest updates, please go here.

XML Comments

Server Side

To include XML comments in the rendered WSDL:

1. Place an XmlComments attribute on your service contract (The interface marked with the ServiceContract attribute) and place xml comments on any service operation or DataContract you want to document:

    [XmlComments]
    [ServiceContract]
    public interface IWsdlSample
    {
        /// <summary>
        /// This is a simple operation without input paramaters.
        /// </summary>
        /// <returns>The operations returns a string</returns>
        [OperationContract]
        string Operation1();
    }

    /// <summary>
    /// A basic class marked with [DataContract]
    /// </summary>
    [DataContract]
    public class DataContractSample
    {
    ...
    }

Client Side

To configure clients to use the custom importers, you should first add a reference to the WCFExtrasPlus assembly on the client and then add a section to the client app.config file.

To generate XML comments from WSDL documentation on the client add the following section to your app.config file:
<system.serviceModel>
  <client>
    <metadata>
      <wsdlImporters>
        <extension type="WCFExtras.Wsdl.Documentation.XmlCommentsImporter, WCFExtras" />
      </wsdlImporters>
    </metadata>
  </client>
</system.serviceModel>


To fine tune the WSDL comment import process you can add an <xmlComments> section to the app.config. See the SampleWCFClient app.config file for details.

Last edited Apr 17, 2011 at 7:21 AM by crjansen, version 4

Comments

karelkrivanek Dec 5, 2013 at 12:41 PM 
replace WCFExtras with WCFExtrasPlus in the client side config