This documentation is archived and is not being maintained.

WebMethodAttribute.Description Property

A descriptive message describing the XML Web service method.

[Visual Basic]
Public Property Description As String
public string Description {get; set;}
public: __property String* get_Description();
public: __property void set_Description(String*);
public function get Description() : String;
public function set Description(String);

Property Value

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


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.


[Visual Basic, C#] 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.

[Visual Basic] 
<%@ 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

<%@ 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;

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

WebMethodAttribute Class | WebMethodAttribute Members | System.Web.Services Namespace | WebMethodAttribute