ServiceDescription::Bindings Property
Gets the collection of Binding elements contained in the ServiceDescription.
Assembly: System.Web.Services (in System.Web.Services.dll)
The BindingCollection returned by this property corresponds to the list of binding elements enclosed by the Web Services Description Language (WSDL) definitions root element. For more information about WSDL, see the specification at http://www.w3.org/TR/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(S"MyWsdl_CS.wsdl"); // Remove the Binding from the BindingCollection of // the ServiceDescription. BindingCollection* myBindingCollection = myDescription->Bindings; myBindingCollection->Remove(myBindingCollection->Item[0]); // Form a new Binding. Binding* myBinding = new Binding(); myBinding->Name = S"Service1Soap"; XmlQualifiedName* myXmlQualifiedName = new XmlQualifiedName(S"s0:Service1Soap"); myBinding->Type = myXmlQualifiedName; SoapBinding* mySoapBinding = new SoapBinding(); mySoapBinding->Transport = S"http://schemas.xmlsoap.org/soap/http"; mySoapBinding->Style = SoapBindingStyle::Document; OperationBinding* addOperationBinding = CreateOperationBinding(S"Add",myDescription->TargetNamespace); myBinding->Operations->Add(addOperationBinding); myBinding->Extensions->Add(mySoapBinding); // Add the Binding to the ServiceDescription. myDescription->Bindings->Add(myBinding); myDescription->Write(S"MyOutWsdl.wsdl");
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.