WebMethodAttribute.Description Property

Definition

A descriptive message describing the XML Web service method.

public string Description { get; set; }

Property Value

A descriptive message describing the XML Web service method. The default value is Empty.

Examples

In the example below, the string Obtains the Server Computer Name is used to describe the XML Web service method in the Service Description and Service help page for the XML Web service.

<%@ WebService Language="C#" Class="Util" %>
 
 using System;
 using System.Web.Services;
 
 public class Util: WebService {
    [ WebMethod(Description="Obtains the Server Computer Name",
    EnableSession=false)]
    public string GetMachineName() {
       return Server.MachineName;
    }   
 }

Remarks

The descriptive message is displayed to prospective consumers of the XML Web service when description documents for the XML Web service are generated, such as the Service Description and the Service help page.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also