WebMethodAttribute 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 WebMethodAttribute 類別的新執行個體。
多載
WebMethodAttribute()
初始化 WebMethodAttribute 類別的新執行個體。
public:
WebMethodAttribute();
public WebMethodAttribute ();
Public Sub New ()
另請參閱
適用於
WebMethodAttribute(Boolean)
初始化 WebMethodAttribute 類別的新執行個體。
public:
WebMethodAttribute(bool enableSession);
public WebMethodAttribute (bool enableSession);
new System.Web.Services.WebMethodAttribute : bool -> System.Web.Services.WebMethodAttribute
Public Sub New (enableSession As Boolean)
參數
- enableSession
- Boolean
初始化是否啟用 XML Web Service 方法的工作階段狀態。
適用於
WebMethodAttribute(Boolean, TransactionOption)
初始化 WebMethodAttribute 類別的新執行個體。
public:
WebMethodAttribute(bool enableSession, System::EnterpriseServices::TransactionOption transactionOption);
public WebMethodAttribute (bool enableSession, System.EnterpriseServices.TransactionOption transactionOption);
new System.Web.Services.WebMethodAttribute : bool * System.EnterpriseServices.TransactionOption -> System.Web.Services.WebMethodAttribute
Public Sub New (enableSession As Boolean, transactionOption As TransactionOption)
參數
- enableSession
- Boolean
初始化是否啟用 XML Web Service 方法的工作階段狀態。
- transactionOption
- TransactionOption
初始化 XML Web Service 方法的交易支援。
備註
Web 服務呼叫只能是交易的根目錄,因為 HTTP 通訊協定的無狀態本質。 這表示下列兩個設定相等,每個呼叫都會建立新的交易:
[WebMethod(TransactionOption = TransactionOption.Required)]
[WebMethod(TransactionOption = TransactionOption.RequiresNew)]
這也表示下列所有設定都相等;表示沒有交易支援:
[WebMethod] // TransactionOption.Disabled is the default
[WebMethod(TransactionOption = TransactionOption.Disabled)]
[WebMethod(TransactionOption = Transaction.NotSupported)]
[WebMethod(TransactionOption = Transaction.Supported)]
適用於
WebMethodAttribute(Boolean, TransactionOption)
public:
WebMethodAttribute(bool enableSession, System::Web::Services::TransactionOption transactionOption);
public WebMethodAttribute (bool enableSession, System.Web.Services.TransactionOption transactionOption);
new System.Web.Services.WebMethodAttribute : bool * System.Web.Services.TransactionOption -> System.Web.Services.WebMethodAttribute
Public Sub New (enableSession As Boolean, transactionOption As TransactionOption)
參數
- enableSession
- Boolean
- transactionOption
- TransactionOption
適用於
WebMethodAttribute(Boolean, TransactionOption, Int32)
初始化 WebMethodAttribute 類別的新執行個體。
public:
WebMethodAttribute(bool enableSession, System::EnterpriseServices::TransactionOption transactionOption, int cacheDuration);
public WebMethodAttribute (bool enableSession, System.EnterpriseServices.TransactionOption transactionOption, int cacheDuration);
new System.Web.Services.WebMethodAttribute : bool * System.EnterpriseServices.TransactionOption * int -> System.Web.Services.WebMethodAttribute
Public Sub New (enableSession As Boolean, transactionOption As TransactionOption, cacheDuration As Integer)
參數
- enableSession
- Boolean
初始化是否啟用 XML Web Service 方法的工作階段狀態。
- transactionOption
- TransactionOption
初始化 XML Web Service 方法的交易支援。
- cacheDuration
- Int32
初始化可快取回應的秒數。
備註
Web 服務呼叫只能是交易的根目錄,因為 HTTP 通訊協定的無狀態本質。 這表示下列兩個設定相等,每個呼叫都會建立新的交易:
[WebMethod(TransactionOption = TransactionOption.Required)]
[WebMethod(TransactionOption = TransactionOption.RequiresNew)]
這也表示下列所有設定都相等;表示沒有交易支援:
[WebMethod] // TransactionOption.Disabled is the default
[WebMethod(TransactionOption = TransactionOption.Disabled)]
[WebMethod(TransactionOption = Transaction.NotSupported)]
[WebMethod(TransactionOption = Transaction.Supported)]
適用於
WebMethodAttribute(Boolean, TransactionOption, Int32)
public:
WebMethodAttribute(bool enableSession, System::Web::Services::TransactionOption transactionOption, int cacheDuration);
public WebMethodAttribute (bool enableSession, System.Web.Services.TransactionOption transactionOption, int cacheDuration);
new System.Web.Services.WebMethodAttribute : bool * System.Web.Services.TransactionOption * int -> System.Web.Services.WebMethodAttribute
Public Sub New (enableSession As Boolean, transactionOption As TransactionOption, cacheDuration As Integer)
參數
- enableSession
- Boolean
- transactionOption
- TransactionOption
- cacheDuration
- Int32
適用於
WebMethodAttribute(Boolean, TransactionOption, Int32, Boolean)
初始化 WebMethodAttribute 類別的新執行個體。
public:
WebMethodAttribute(bool enableSession, System::EnterpriseServices::TransactionOption transactionOption, int cacheDuration, bool bufferResponse);
public WebMethodAttribute (bool enableSession, System.EnterpriseServices.TransactionOption transactionOption, int cacheDuration, bool bufferResponse);
new System.Web.Services.WebMethodAttribute : bool * System.EnterpriseServices.TransactionOption * int * bool -> System.Web.Services.WebMethodAttribute
Public Sub New (enableSession As Boolean, transactionOption As TransactionOption, cacheDuration As Integer, bufferResponse As Boolean)
參數
- enableSession
- Boolean
初始化是否啟用 XML Web Service 方法的工作階段狀態。
- transactionOption
- TransactionOption
初始化 XML Web Service 方法的交易支援。
- cacheDuration
- Int32
初始化可快取回應的秒數。
- bufferResponse
- Boolean
初始化這個要求的回應是否緩衝。
備註
Web 服務呼叫只能是交易的根目錄,因為 HTTP 通訊協定的無狀態本質。 這表示下列兩個設定相等,每個呼叫都會建立新的交易:
[WebMethod(TransactionOption = TransactionOption.Required)]
[WebMethod(TransactionOption = TransactionOption.RequiresNew)]
這也表示下列所有設定都相等;表示沒有交易支援:
[WebMethod] // TransactionOption.Disabled is the default
[WebMethod(TransactionOption = TransactionOption.Disabled)]
[WebMethod(TransactionOption = Transaction.NotSupported)]
[WebMethod(TransactionOption = Transaction.Supported)]
適用於
WebMethodAttribute(Boolean, TransactionOption, Int32, Boolean)
public:
WebMethodAttribute(bool enableSession, System::Web::Services::TransactionOption transactionOption, int cacheDuration, bool bufferResponse);
public WebMethodAttribute (bool enableSession, System.Web.Services.TransactionOption transactionOption, int cacheDuration, bool bufferResponse);
new System.Web.Services.WebMethodAttribute : bool * System.Web.Services.TransactionOption * int * bool -> System.Web.Services.WebMethodAttribute
Public Sub New (enableSession As Boolean, transactionOption As TransactionOption, cacheDuration As Integer, bufferResponse As Boolean)
參數
- enableSession
- Boolean
- transactionOption
- TransactionOption
- cacheDuration
- Int32
- bufferResponse
- Boolean