Freigeben über


FaultBindingCollection.Item[] Eigenschaft

Definition

Ruft die FaultBinding-Instanz ab, die vom übergebenen Parameter angegeben wird, oder legt diese fest.

Überlädt

Item[Int32]

Ruft den Wert eines FaultBinding am angegebenen nullbasierten Index ab oder legt diesen fest.

Item[String]

Ruft einen FaultBinding ab, der durch seinen Namen angegeben wird.

Item[Int32]

Quelle:
ServiceDescription.cs
Quelle:
ServiceDescription.cs
Quelle:
ServiceDescription.cs

Ruft den Wert eines FaultBinding am angegebenen nullbasierten Index ab oder legt diesen fest.

public:
 property System::Web::Services::Description::FaultBinding ^ default[int] { System::Web::Services::Description::FaultBinding ^ get(int index); void set(int index, System::Web::Services::Description::FaultBinding ^ value); };
public System.Web.Services.Description.FaultBinding this[int index] { get; set; }
member this.Item(int) : System.Web.Services.Description.FaultBinding with get, set
Default Public Property Item(index As Integer) As FaultBinding

Parameter

index
Int32

Der nullbasierte Index der FaultBinding, deren Wert geändert oder zurückgegeben wird.

Eigenschaftswert

einen FaultBinding

Ausnahmen

Der index-Parameter ist kleiner als 0 (null).

- oder -

Der index-Parameter ist größer als Count.

Beispiele

Im folgenden Beispiel wird eine typische Verwendung der FaultBinding -Klasse veranschaulicht.

FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults;
FaultBinding^ myFaultBinding = gcnew FaultBinding;
myFaultBinding->Name = "ErrorString";
// Associate SOAP fault binding to the fault binding of the operation.
myExtensions = myFaultBinding->Extensions;
SoapFaultBinding^ mySoapFaultBinding = gcnew SoapFaultBinding;
mySoapFaultBinding->Use = SoapBindingUse::Literal;
mySoapFaultBinding->Namespace = "http://www.contoso.com/stockquote";
myExtensions->Add( mySoapFaultBinding );
myFaultBindingCollection->Add( myFaultBinding );
FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults;
FaultBinding myFaultBinding = new FaultBinding();
myFaultBinding.Name = "ErrorString";
// Associate SOAP fault binding to the fault binding of the operation.
myExtensions = myFaultBinding.Extensions;
SoapFaultBinding mySoapFaultBinding = new SoapFaultBinding();
mySoapFaultBinding.Use = SoapBindingUse.Literal;
mySoapFaultBinding.Namespace = "http://www.contoso.com/stockquote";
myExtensions.Add(mySoapFaultBinding);
myFaultBindingCollection.Add(myFaultBinding);
Dim myFaultBindingCollection As FaultBindingCollection = myOperationBinding.Faults
Dim myFaultBinding As New FaultBinding()
myFaultBinding.Name = "ErrorString"
' Associate SOAP fault binding to the fault binding of the operation.
myExtensions = myFaultBinding.Extensions
Dim mySoapFaultBinding As New SoapFaultBinding()
mySoapFaultBinding.Use = SoapBindingUse.Literal
mySoapFaultBinding.Namespace = "http://www.contoso.com/stockquote"
myExtensions.Add(mySoapFaultBinding)
myFaultBindingCollection.Add(myFaultBinding)

Gilt für:

Item[String]

Quelle:
ServiceDescription.cs
Quelle:
ServiceDescription.cs
Quelle:
ServiceDescription.cs

Ruft einen FaultBinding ab, der durch seinen Namen angegeben wird.

public:
 property System::Web::Services::Description::FaultBinding ^ default[System::String ^] { System::Web::Services::Description::FaultBinding ^ get(System::String ^ name); };
public System.Web.Services.Description.FaultBinding this[string name] { get; }
member this.Item(string) : System.Web.Services.Description.FaultBinding
Default Public ReadOnly Property Item(name As String) As FaultBinding

Parameter

name
String

Der Name des zurückgegebenen FaultBinding.

Eigenschaftswert

einen FaultBinding

Beispiele

Das folgende Beispiel veranschaulicht eine typische Verwendung dieser Eigenschaft.

BindingCollection^ myBindingCollection = myServiceDescription->Bindings;
Binding^ myBinding = myBindingCollection[ 0 ];
OperationBindingCollection^ myOperationBindingCollection = myBinding->Operations;
OperationBinding^ myOperationBinding = myOperationBindingCollection[ 0 ];
FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults;
if ( myFaultBindingCollection->Contains( myFaultBindingCollection[ "ErrorString" ] ) )
   myFaultBindingCollection->Remove( myFaultBindingCollection[ "ErrorString" ] );
BindingCollection myBindingCollection = myServiceDescription.Bindings;
Binding myBinding = myBindingCollection[0];
OperationBindingCollection myOperationBindingCollection = myBinding.Operations;
OperationBinding myOperationBinding = myOperationBindingCollection[0];
FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults;
if(myFaultBindingCollection.Contains(myFaultBindingCollection["ErrorString"]))
   myFaultBindingCollection.Remove(myFaultBindingCollection["ErrorString"]);
Dim myBindingCollection As BindingCollection = myServiceDescription.Bindings
Dim myBinding As Binding = myBindingCollection(0)
Dim myOperationBindingCollection As OperationBindingCollection = myBinding.Operations
Dim myOperationBinding As OperationBinding = myOperationBindingCollection(0)
Dim myFaultBindingCollection As FaultBindingCollection = myOperationBinding.Faults
If myFaultBindingCollection.Contains(myFaultBindingCollection("ErrorString")) Then
   myFaultBindingCollection.Remove(myFaultBindingCollection("ErrorString"))
  End If

Gilt für: