WebMethodAttribute.Description Property


A descriptive message describing the XML Web service method.

 property System::String ^ Description { System::String ^ get(); void set(System::String ^ value); };
public string Description { get; set; }
member this.Description : string with get, set
Public Property Description As String

Property Value

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


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",
    public string GetMachineName() {
       return Server.MachineName;
<%@ WebService Language="VB" Class="Util" %>

Imports System
Imports System.Web.Services

Public Class Util
    Inherits WebService

    <WebMethod(Description := "Obtains the Server Computer Name", _
        EnableSession := False)> _
    Public Function GetMachineName() As String
        Return Server.MachineName
    End Function
End Class


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

See also