次の方法で共有


FaultBindingCollection.Item[] プロパティ

定義

渡されたパラメーターによって指定された FaultBinding インスタンスを取得または設定します。

オーバーロード

Item[Int32]

指定の 0 から始まるインデックス番号に対応する FaultBinding の値を取得または設定します。

Item[String]

名前で指定された FaultBinding を取得します。

Item[Int32]

ソース:
ServiceDescription.cs
ソース:
ServiceDescription.cs
ソース:
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]

ソース:
ServiceDescription.cs
ソース:
ServiceDescription.cs
ソース:
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

適用対象