[WebMethodAttribute(true)]是什么意思?
下面是atton.asmx.cs文件,在这个文件中add方法上有[WebMethodAttribute(true)]
这句话,我知道是把add方法声明为XML Web Services方法,
但为为什么不用[WebMethod],还有[WebMethodAttribute(true)]这句话具体是什么意思,为什么加true
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Web;
using System.Web.Services;
using System.Xml;
namespace MyWebService
{
[WebService(Namespace="http://localhost/MyWebService/")]
public class Atton: System.Web.Services.WebService
{
private Glad glad;
public atton()
{
InitializeComponent();
glad= new Glad(base.Application);
}
#region Component Designer generated code
//Web 服务设计器所必需的
private IContainer components = null;
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
[WebMethodAttribute(true)]
public DataSet add()
{
return glad;
}
}
}