ServiceDescriptionBaseCollection Class
Forms the basis for the strongly typed collections that are members of the System.Web.Services.Description namespace.
Assembly: System.Web.Services (in System.Web.Services.dll)
System.Collections.CollectionBase
System.Web.Services.Description.ServiceDescriptionBaseCollection
System.Web.Services.Description.BindingCollection
System.Web.Services.Description.FaultBindingCollection
System.Web.Services.Description.ImportCollection
System.Web.Services.Description.MessageCollection
System.Web.Services.Description.MessagePartCollection
System.Web.Services.Description.OperationBindingCollection
System.Web.Services.Description.OperationCollection
System.Web.Services.Description.OperationFaultCollection
System.Web.Services.Description.OperationMessageCollection
System.Web.Services.Description.PortCollection
System.Web.Services.Description.PortTypeCollection
System.Web.Services.Description.ServiceCollection
System.Web.Services.Description.ServiceDescriptionCollection
System.Web.Services.Description.ServiceDescriptionFormatExtensionCollection
| Name | Description | |
|---|---|---|
![]() | Capacity | Gets or sets the number of elements that the CollectionBase can contain.(Inherited from CollectionBase.) |
![]() | Count | Gets the number of elements contained in the CollectionBase instance. This property cannot be overridden.(Inherited from CollectionBase.) |
![]() | InnerList | Gets an ArrayList containing the list of elements in the CollectionBase instance.(Inherited from CollectionBase.) |
![]() | List | Gets an IList containing the list of elements in the CollectionBase instance.(Inherited from CollectionBase.) |
![]() | Table | Gets an interface that implements the association of the keys and values in the ServiceDescriptionBaseCollection. |
| Name | Description | |
|---|---|---|
![]() | Clear() | Removes all objects from the CollectionBase instance. This method cannot be overridden.(Inherited from CollectionBase.) |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetEnumerator() | Returns an enumerator that iterates through the CollectionBase instance.(Inherited from CollectionBase.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetKey(Object) | Returns the name of the key associated with the value passed by reference. |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | OnClear() | Clears the contents of the ServiceDescriptionBaseCollection instance.(Overrides CollectionBase.OnClear().) |
![]() | OnClearComplete() | Performs additional custom processes after clearing the contents of the CollectionBase instance.(Inherited from CollectionBase.) |
![]() | OnInsert(Int32, Object) | Performs additional custom processes before inserting a new element into the CollectionBase instance.(Inherited from CollectionBase.) |
![]() | OnInsertComplete(Int32, Object) | Performs additional custom processes after inserting a new element into the ServiceDescriptionBaseCollection.(Overrides CollectionBase.OnInsertComplete(Int32, Object).) |
![]() | OnRemove(Int32, Object) | Removes an element from the ServiceDescriptionBaseCollection.(Overrides CollectionBase.OnRemove(Int32, Object).) |
![]() | OnRemoveComplete(Int32, Object) | Performs additional custom processes after removing an element from the CollectionBase instance.(Inherited from CollectionBase.) |
![]() | OnSet(Int32, Object, Object) | Replaces one value with another within the ServiceDescriptionBaseCollection.(Overrides CollectionBase.OnSet(Int32, Object, Object).) |
![]() | OnSetComplete(Int32, Object, Object) | Performs additional custom processes after setting a value in the CollectionBase instance.(Inherited from CollectionBase.) |
![]() | OnValidate(Object) | Performs additional custom processes when validating a value.(Inherited from CollectionBase.) |
![]() | RemoveAt(Int32) | Removes the element at the specified index of the CollectionBase instance. This method is not overridable.(Inherited from CollectionBase.) |
![]() | SetParent(Object, Object) | Sets the parent object of the ServiceDescriptionBaseCollection instance. |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection.CopyTo(Array, Int32) | Copies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.(Inherited from CollectionBase.) |
![]() ![]() | IList.Add(Object) | Adds an object to the end of the CollectionBase.(Inherited from CollectionBase.) |
![]() ![]() | IList.Contains(Object) | Determines whether the CollectionBase contains a specific element.(Inherited from CollectionBase.) |
![]() ![]() | IList.IndexOf(Object) | Searches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase.(Inherited from CollectionBase.) |
![]() ![]() | IList.Insert(Int32, Object) | Inserts an element into the CollectionBase at the specified index.(Inherited from CollectionBase.) |
![]() ![]() | IList.Remove(Object) | Removes the first occurrence of a specific object from the CollectionBase.(Inherited from CollectionBase.) |
![]() ![]() | ICollection.IsSynchronized | Gets a value indicating whether access to the CollectionBase is synchronized (thread safe).(Inherited from CollectionBase.) |
![]() ![]() | ICollection.SyncRoot | Gets an object that can be used to synchronize access to the CollectionBase.(Inherited from CollectionBase.) |
![]() ![]() | IList.IsFixedSize | Gets a value indicating whether the CollectionBase has a fixed size.(Inherited from CollectionBase.) |
![]() ![]() | IList.IsReadOnly | Gets a value indicating whether the CollectionBase is read-only.(Inherited from CollectionBase.) |
![]() ![]() | IList.Item[Int32] | Gets or sets the element at the specified index.(Inherited from CollectionBase.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel() | Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.) |
![]() | AsQueryable() | Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.) |
![]() | Cast<TResult>() | Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.) |
![]() | OfType<TResult>() | Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.) |
public static void MyMethod( ServiceDescriptionBaseCollection myServiceCollection) { Type myType = myServiceCollection.GetType(); if (myType.Equals( typeof(System.Web.Services.Description.ServiceCollection))) { // Remove the services at index 0 of the collection. ((ServiceCollection)myServiceCollection).Remove( myServiceDescription.Services[0]); // Build a new Service. Service myService =new Service(); myService.Name="MathService"; XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("s0:MathServiceSoap"); // Build a new Port for SOAP. Port mySoapPort= new Port(); mySoapPort.Name="MathServiceSoap"; mySoapPort.Binding=myXmlQualifiedName; SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); mySoapAddressBinding.Location = "http://localhost/" + "ServiceDescriptionBaseCollection/AddSubtractService.CS.asmx"; mySoapPort.Extensions.Add(mySoapAddressBinding); // Build a new Port for HTTP-GET. XmlQualifiedName myXmlQualifiedName2 = new XmlQualifiedName("s0:MathServiceHttpGet"); Port myHttpGetPort= new Port(); myHttpGetPort.Name="MathServiceHttpGet"; myHttpGetPort.Binding=myXmlQualifiedName2; HttpAddressBinding myHttpAddressBinding = new HttpAddressBinding(); myHttpAddressBinding.Location = "http://localhost/" + "ServiceDescriptionBaseCollection/AddSubtractService.CS.asmx"; myHttpGetPort.Extensions.Add(myHttpAddressBinding); // Add the ports to the Service. myService.Ports.Add(myHttpGetPort); myService.Ports.Add(mySoapPort); // Add the Service to the ServiceCollection. myServiceDescription.Services.Add(myService); } else if(myType.Equals( typeof(System.Web.Services.Description.BindingCollection))) { // Remove the Binding in the BindingCollection at index 0. ((BindingCollection)myServiceCollection).Remove( myServiceDescription.Bindings[0]); // Build a new Binding. Binding myBinding = new Binding(); myBinding.Name = "MathServiceSoap"; XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("s0:MathServiceSoap"); myBinding.Type=myXmlQualifiedName; SoapBinding mySoapBinding = new SoapBinding(); mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"; mySoapBinding.Style = SoapBindingStyle.Document; // Create the operations for the binding. OperationBinding addOperationBinding = CreateOperationBinding( "Add", myServiceDescription.TargetNamespace); OperationBinding subtractOperationBinding = CreateOperationBinding( "Subtract",myServiceDescription.TargetNamespace); // Add the operations to the Binding. myBinding.Operations.Add(subtractOperationBinding); myBinding.Operations.Add(addOperationBinding); myBinding.Extensions.Add(mySoapBinding); // Add the Binding to the Bindings collection. myServiceDescription.Bindings.Add(myBinding); } else if (myType.Equals( typeof(System.Web.Services.Description.PortTypeCollection))) { // Remove the PortType at index 0. ((PortTypeCollection)myServiceCollection).Remove( myServiceDescription.PortTypes[0]); // Build a new PortType. PortType myPortType = new PortType(); myPortType.Name = "MathServiceSoap"; // Build an Add Operation for the PortType. Operation myAddOperation = new Operation(); myAddOperation.Name="Add"; // Build the Input and Output messages for the Operations. OperationInput myOperationInputMessage1 = new OperationInput(); XmlQualifiedName myXmlQualifiedName1 = new XmlQualifiedName("s0:AddSoapIn"); myOperationInputMessage1.Message = myXmlQualifiedName1; OperationOutput myOperationOutputMessage1 = new OperationOutput(); XmlQualifiedName myXmlQualifiedName2 = new XmlQualifiedName("s0:AddSoapOut"); myOperationOutputMessage1.Message=myXmlQualifiedName2; // Add the messages to the operations. myAddOperation.Messages.Add(myOperationInputMessage1); myAddOperation.Messages.Add(myOperationOutputMessage1); // Build an Add Operation for the PortType. Operation mySubtractOperation = new Operation(); mySubtractOperation.Name = "Subtract"; // Build the Input and Output messages for the operations. OperationInput myOperationInputMessage2 = new OperationInput(); XmlQualifiedName myXmlQualifiedName3 = new XmlQualifiedName("s0:SubtractSoapIn"); myOperationInputMessage2.Message = myXmlQualifiedName3; OperationOutput myOperationOutputMessage2 = new OperationOutput(); XmlQualifiedName myXmlQualifiedName4 = new XmlQualifiedName("s0:SubtractSoapOut"); myOperationOutputMessage2.Message = myXmlQualifiedName4; // Add the messages to the operations. mySubtractOperation.Messages.Add(myOperationInputMessage2); mySubtractOperation.Messages.Add(myOperationOutputMessage2); // Add the operations to the PortType. myPortType.Operations.Add(myAddOperation); myPortType.Operations.Add(mySubtractOperation); // Add the PortType to the collection. myServiceDescription.PortTypes.Add(myPortType); } }
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.






