ServiceDescription.Bindings プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Binding に格納されている ServiceDescription 要素のコレクションを取得します。
public:
property System::Web::Services::Description::BindingCollection ^ Bindings { System::Web::Services::Description::BindingCollection ^ get(); };
public System.Web.Services.Description.BindingCollection Bindings { get; }
member this.Bindings : System.Web.Services.Description.BindingCollection
Public ReadOnly Property Bindings As BindingCollection
プロパティ値
サービスの説明に含まれるバインディング要素のコレクション。
例
// Obtain the ServiceDescription from existing WSDL.
ServiceDescription^ myDescription = ServiceDescription::Read( "MyWsdl_CS.wsdl" );
// Remove the Binding from the BindingCollection of
// the ServiceDescription.
BindingCollection^ myBindingCollection = myDescription->Bindings;
myBindingCollection->Remove( myBindingCollection[ 0 ] );
// Form a new Binding.
Binding^ myBinding = gcnew Binding;
myBinding->Name = "Service1Soap";
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:Service1Soap" );
myBinding->Type = myXmlQualifiedName;
SoapBinding^ mySoapBinding = gcnew SoapBinding;
mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http";
mySoapBinding->Style = SoapBindingStyle::Document;
OperationBinding^ addOperationBinding = CreateOperationBinding( "Add", myDescription->TargetNamespace );
myBinding->Operations->Add( addOperationBinding );
myBinding->Extensions->Add( mySoapBinding );
// Add the Binding to the ServiceDescription.
myDescription->Bindings->Add( myBinding );
myDescription->Write( "MyOutWsdl.wsdl" );
// Obtain the ServiceDescription from existing WSDL.
ServiceDescription myDescription =
ServiceDescription.Read("MyWsdl_CS.wsdl");
// Remove the Binding from the BindingCollection of
// the ServiceDescription.
BindingCollection myBindingCollection = myDescription.Bindings;
myBindingCollection.Remove(myBindingCollection[0]);
// Form a new Binding.
Binding myBinding = new Binding();
myBinding.Name = "Service1Soap";
XmlQualifiedName myXmlQualifiedName =
new XmlQualifiedName("s0:Service1Soap");
myBinding.Type = myXmlQualifiedName;
SoapBinding mySoapBinding = new SoapBinding();
mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http";
mySoapBinding.Style = SoapBindingStyle.Document;
OperationBinding addOperationBinding =
CreateOperationBinding("Add",myDescription.TargetNamespace);
myBinding.Operations.Add(addOperationBinding);
myBinding.Extensions.Add(mySoapBinding);
// Add the Binding to the ServiceDescription.
myDescription.Bindings.Add(myBinding);
myDescription.Write("MyOutWsdl.wsdl");
' Obtain the ServiceDescription from existing WSDL.
Dim myDescription As ServiceDescription = _
ServiceDescription.Read("MyWsdl_VB.wsdl")
' Remove the Binding from the BindingCollection of
' the ServiceDescription.
Dim myBindingCollection As BindingCollection = _
myDescription.Bindings
myBindingCollection.Remove(myBindingCollection(0))
' Form a new Binding.
Dim myBinding As New Binding()
myBinding.Name = "Service1Soap"
Dim myXmlQualifiedName As New XmlQualifiedName("s0:Service1Soap")
myBinding.Type = myXmlQualifiedName
Dim mySoapBinding As New SoapBinding()
mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"
mySoapBinding.Style = SoapBindingStyle.Document
Dim addOperationBinding As OperationBinding = _
CreateOperationBinding("Add", myDescription.TargetNamespace)
myBinding.Operations.Add(addOperationBinding)
myBinding.Extensions.Add(mySoapBinding)
' Add the Binding to the ServiceDescription.
myDescription.Bindings.Add(myBinding)
myDescription.Write("MyOutWsdl.wsdl")
注釈
このプロパティによって返される値はBindingCollection、Web サービス記述言語 (WSDL) definitions
ルート要素で囲まれた要素のbinding
一覧に対応します。 WSDL の詳細については、WSDL 仕様を参照してください。