ServiceDescription.Bindings プロパティ
アセンブリ: System.Web.Services (system.web.services.dll 内)

BindingCollection。

このプロパティから返される BindingCollection は、Web サービス記述言語 (WSDL: Web Services Description Language) definitions ルート要素で囲まれた binding 要素のリストに対応します。WSDL の詳細については、http://www.w3.org/TR/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")
// 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. 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_JSL.wsdl"); // Remove the Binding from the BindingCollection of // the ServiceDescription. BindingCollection myBindingCollection = myDescription.get_Bindings(); myBindingCollection.Remove(myBindingCollection.get_Item(0)); // Form a new Binding. Binding myBinding = new Binding(); myBinding.set_Name("Service1Soap"); XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("s0:Service1Soap"); myBinding.set_Type(myXmlQualifiedName); SoapBinding mySoapBinding = new SoapBinding(); mySoapBinding.set_Transport("http://schemas.xmlsoap.org/soap/http"); mySoapBinding.set_Style(SoapBindingStyle.Document); OperationBinding addOperationBinding = CreateOperationBinding("Add", myDescription.get_TargetNamespace()); myBinding.get_Operations().Add(addOperationBinding); myBinding.get_Extensions().Add(mySoapBinding); // Add the Binding to the ServiceDescription. myDescription.get_Bindings().Add(myBinding); myDescription.Write("MyOutWsdl.wsdl");

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- ServiceDescription.Bindings プロパティのページへのリンク