Share via


WebMethodAttribute Konstruktoren

Definition

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

Überlädt

WebMethodAttribute()

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

WebMethodAttribute(Boolean)

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

WebMethodAttribute(Boolean, TransactionOption)

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

WebMethodAttribute(Boolean, TransactionOption)
WebMethodAttribute(Boolean, TransactionOption, Int32)

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

WebMethodAttribute(Boolean, TransactionOption, Int32)
WebMethodAttribute(Boolean, TransactionOption, Int32, Boolean)

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

WebMethodAttribute(Boolean, TransactionOption, Int32, Boolean)

WebMethodAttribute()

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

public:
 WebMethodAttribute();
public WebMethodAttribute ();
Public Sub New ()

Siehe auch

Gilt für

WebMethodAttribute(Boolean)

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

public:
 WebMethodAttribute(bool enableSession);
public WebMethodAttribute (bool enableSession);
new System.Web.Services.WebMethodAttribute : bool -> System.Web.Services.WebMethodAttribute
Public Sub New (enableSession As Boolean)

Parameter

enableSession
Boolean

Initialisiert die Aktivierung des Sitzungszustands für die XML-Webdienstmethode.

Gilt für

WebMethodAttribute(Boolean, TransactionOption)

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

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)

Parameter

enableSession
Boolean

Initialisiert die Aktivierung des Sitzungszustands für die XML-Webdienstmethode.

transactionOption
TransactionOption

Initialisiert die Transaktionsunterstützung einer XML-Webdienstmethode.

Hinweise

Ein Webdienstaufruf kann nur der Stamm einer Transaktion sein, aufgrund der zustandslosen Natur des HTTP-Protokolls. Dies bedeutet, dass die folgenden beiden Einstellungen gleichwertig sind, wobei jeder Aufruf eine neue Transaktion erstellt:

[WebMethod(TransactionOption = TransactionOption.Required)]  
[WebMethod(TransactionOption = TransactionOption.RequiresNew)]  

Es bedeutet auch, dass alle folgenden Einstellungen gleichwertig sind; bedeutet keine Transaktionsunterstützung:

[WebMethod] // TransactionOption.Disabled is the default  
[WebMethod(TransactionOption = TransactionOption.Disabled)]  
[WebMethod(TransactionOption = Transaction.NotSupported)]  
[WebMethod(TransactionOption = Transaction.Supported)]  

Gilt für

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)

Parameter

enableSession
Boolean
transactionOption
TransactionOption

Gilt für

WebMethodAttribute(Boolean, TransactionOption, Int32)

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

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)

Parameter

enableSession
Boolean

Initialisiert die Aktivierung des Sitzungszustands für die XML-Webdienstmethode.

transactionOption
TransactionOption

Initialisiert die Transaktionsunterstützung einer XML-Webdienstmethode.

cacheDuration
Int32

Initialisiert die Anzahl der Sekunden, für die die Antwort zwischengespeichert wird.

Hinweise

Ein Webdienstaufruf kann nur der Stamm einer Transaktion sein, aufgrund der zustandslosen Natur des HTTP-Protokolls. Dies bedeutet, dass die folgenden beiden Einstellungen gleichwertig sind, wobei jeder Aufruf eine neue Transaktion erstellt:

[WebMethod(TransactionOption = TransactionOption.Required)]  
[WebMethod(TransactionOption = TransactionOption.RequiresNew)]  

Es bedeutet auch, dass alle folgenden Einstellungen gleichwertig sind; bedeutet keine Transaktionsunterstützung:

[WebMethod] // TransactionOption.Disabled is the default  
[WebMethod(TransactionOption = TransactionOption.Disabled)]  
[WebMethod(TransactionOption = Transaction.NotSupported)]  
[WebMethod(TransactionOption = Transaction.Supported)]  

Gilt für

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)

Parameter

enableSession
Boolean
transactionOption
TransactionOption
cacheDuration
Int32

Gilt für

WebMethodAttribute(Boolean, TransactionOption, Int32, Boolean)

Initialisiert eine neue Instanz der WebMethodAttribute-Klasse.

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)

Parameter

enableSession
Boolean

Initialisiert die Aktivierung des Sitzungszustands für die XML-Webdienstmethode.

transactionOption
TransactionOption

Initialisiert die Transaktionsunterstützung einer XML-Webdienstmethode.

cacheDuration
Int32

Initialisiert die Anzahl der Sekunden, für die die Antwort zwischengespeichert wird.

bufferResponse
Boolean

Initialisiert die Pufferung der Antwort auf diese Anforderung.

Hinweise

Ein Webdienstaufruf kann nur der Stamm einer Transaktion sein, aufgrund der zustandslosen Natur des HTTP-Protokolls. Dies bedeutet, dass die folgenden beiden Einstellungen gleichwertig sind, wobei jeder Aufruf eine neue Transaktion erstellt:

[WebMethod(TransactionOption = TransactionOption.Required)]  
[WebMethod(TransactionOption = TransactionOption.RequiresNew)]  

Es bedeutet auch, dass alle folgenden Einstellungen gleichwertig sind; bedeutet keine Transaktionsunterstützung:

[WebMethod] // TransactionOption.Disabled is the default  
[WebMethod(TransactionOption = TransactionOption.Disabled)]  
[WebMethod(TransactionOption = Transaction.NotSupported)]  
[WebMethod(TransactionOption = Transaction.Supported)]  

Gilt für

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)

Parameter

enableSession
Boolean
transactionOption
TransactionOption
cacheDuration
Int32
bufferResponse
Boolean

Gilt für