다음을 통해 공유


ServiceDescription.Bindings 속성

정의

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

속성 값

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 요소는 WSDL(Web Services Description Language) definitions 루트 요소로 묶인 요소 목록에 binding 해당합니다. WSDL에 대한 자세한 내용은 WSDL 사양을 참조하세요.

적용 대상