다음을 통해 공유


FaultBindingCollection.Item[] 속성

정의

전달된 매개 변수에서 지정한 FaultBinding 인스턴스를 가져오거나 설정합니다.

오버로드

Item[Int32]

지정된 인덱스(0부터 시작)에서 FaultBinding의 값을 가져오거나 설정합니다.

Item[String]

이름으로 지정된 FaultBinding를 가져옵니다.

Item[Int32]

Source:
ServiceDescription.cs
Source:
ServiceDescription.cs
Source:
ServiceDescription.cs

지정된 인덱스(0부터 시작)에서 FaultBinding의 값을 가져오거나 설정합니다.

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

매개 변수

index
Int32

값이 수정되거나 반환된 FaultBinding의 인덱스이며 0부터 시작합니다.

속성 값

FaultBinding.

예외

index 매개 변수가 0보다 작습니다.

또는

index 매개 변수가 Count보다 큰 경우

예제

다음 예제에서는의 일반적인 용도 FaultBinding 클래스입니다.

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)

적용 대상

Item[String]

Source:
ServiceDescription.cs
Source:
ServiceDescription.cs
Source:
ServiceDescription.cs

이름으로 지정된 FaultBinding를 가져옵니다.

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

매개 변수

name
String

반환된 FaultBinding 이름입니다.

속성 값

FaultBinding.

예제

다음 예제에서는이 속성의 일반적인 사용을 보여 줍니다.

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

적용 대상