ServiceDescriptionBaseCollection Klas
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Vormt de basis voor de sterk getypte verzamelingen die lid zijn van de System.Web.Services.Description naamruimte.
public ref class ServiceDescriptionBaseCollection abstract : System::Collections::CollectionBase
public abstract class ServiceDescriptionBaseCollection : System.Collections.CollectionBase
type ServiceDescriptionBaseCollection = class
inherit CollectionBase
Public MustInherit Class ServiceDescriptionBaseCollection
Inherits CollectionBase
- Overname
- Afgeleid
Voorbeelden
static void MyMethod( ServiceDescriptionBaseCollection^ myServiceCollection )
{
Type^ myType = myServiceCollection->GetType();
if ( myType->Equals( System::Web::Services::Description::ServiceCollection::typeid ) )
{
// Remove the services at index 0 of the collection.
(dynamic_cast<ServiceCollection^>(myServiceCollection))->Remove( myServiceDescription->Services[ 0 ] );
// Build a new Service.
Service^ myService = gcnew Service;
myService->Name = "MathService";
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MathServiceSoap" );
// Build a new Port for SOAP.
Port^ mySoapPort = gcnew Port;
mySoapPort->Name = "MathServiceSoap";
mySoapPort->Binding = myXmlQualifiedName;
SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding;
mySoapAddressBinding->Location = "http://localhost/"
"ServiceDescriptionBaseCollection/AddSubtractService.CS.asmx";
mySoapPort->Extensions->Add( mySoapAddressBinding );
// Build a new Port for HTTP-GET.
XmlQualifiedName^ myXmlQualifiedName2 = gcnew XmlQualifiedName( "s0:MathServiceHttpGet" );
Port^ myHttpGetPort = gcnew Port;
myHttpGetPort->Name = "MathServiceHttpGet";
myHttpGetPort->Binding = myXmlQualifiedName2;
HttpAddressBinding^ myHttpAddressBinding = gcnew 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( System::Web::Services::Description::BindingCollection::typeid ) )
{
// Remove the Binding in the BindingCollection at index 0.
(dynamic_cast<BindingCollection^>(myServiceCollection))->Remove( myServiceDescription->Bindings[ 0 ] );
// Build a new Binding.
Binding^ myBinding = gcnew Binding;
myBinding->Name = "MathServiceSoap";
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:MathServiceSoap" );
myBinding->Type = myXmlQualifiedName;
SoapBinding^ mySoapBinding = gcnew 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( System::Web::Services::Description::PortTypeCollection::typeid ) )
{
// Remove the PortType at index 0.
(dynamic_cast<PortTypeCollection^>(myServiceCollection))->Remove( myServiceDescription->PortTypes[ 0 ] );
// Build a new PortType.
PortType^ myPortType = gcnew PortType;
myPortType->Name = "MathServiceSoap";
// Build an Add Operation for the PortType.
Operation^ myAddOperation = gcnew Operation;
myAddOperation->Name = "Add";
// Build the Input and Output messages for the Operations.
OperationInput^ myOperationInputMessage1 = gcnew OperationInput;
XmlQualifiedName^ myXmlQualifiedName1 = gcnew XmlQualifiedName( "s0:AddSoapIn" );
myOperationInputMessage1->Message = myXmlQualifiedName1;
OperationOutput^ myOperationOutputMessage1 = gcnew OperationOutput;
XmlQualifiedName^ myXmlQualifiedName2 = gcnew 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 = gcnew Operation;
mySubtractOperation->Name = "Subtract";
// Build the Input and Output messages for the operations.
OperationInput^ myOperationInputMessage2 = gcnew OperationInput;
XmlQualifiedName^ myXmlQualifiedName3 = gcnew XmlQualifiedName( "s0:SubtractSoapIn" );
myOperationInputMessage2->Message = myXmlQualifiedName3;
OperationOutput^ myOperationOutputMessage2 = gcnew OperationOutput;
XmlQualifiedName^ myXmlQualifiedName4 = gcnew 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 );
}
}
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);
}
}
Public Shared Sub MyMethod(myServiceCollection As _
ServiceDescriptionBaseCollection)
Dim myType As Type = myServiceCollection.GetType()
If myType.Equals( _
GetType(System.Web.Services.Description.ServiceCollection)) Then
' Remove the services at index 0 of the collection.
CType(myServiceCollection, ServiceCollection).Remove( _
myServiceDescription.Services(0))
' Build a new Service.
Dim myService As New Service()
myService.Name = "MathService"
Dim myXmlQualifiedName As _
New XmlQualifiedName("s0:MathServiceSoap")
' Build a new Port for SOAP.
Dim mySoapPort As New Port()
mySoapPort.Name = "MathServiceSoap"
mySoapPort.Binding = myXmlQualifiedName
Dim mySoapAddressBinding As New SoapAddressBinding()
mySoapAddressBinding.Location = "http://localhost/" & _
"ServiceDescriptionBaseCollection_VB/AddSubtractService.VB.asmx"
mySoapPort.Extensions.Add(mySoapAddressBinding)
' Build a new Port for HTTP-GET.
Dim myXmlQualifiedName2 As _
New XmlQualifiedName("s0:MathServiceHttpGet")
Dim myHttpGetPort As New Port()
myHttpGetPort.Name = "MathServiceHttpGet"
myHttpGetPort.Binding = myXmlQualifiedName2
Dim myHttpAddressBinding As New HttpAddressBinding()
myHttpAddressBinding.Location = "http://localhost/" & _
"ServiceDescriptionBaseCollection_VB/AddSubtractService.VB.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( _
GetType(System.Web.Services.Description.BindingCollection)) Then
' Remove the Binding in the BindingCollection at index 0.
CType(myServiceCollection, BindingCollection).Remove( _
myServiceDescription.Bindings(0))
' Build a new Binding.
Dim myBinding As New Binding()
myBinding.Name = "MathServiceSoap"
Dim myXmlQualifiedName As _
New XmlQualifiedName("s0:MathServiceSoap")
myBinding.Type = myXmlQualifiedName
Dim mySoapBinding As New SoapBinding()
mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"
mySoapBinding.Style = SoapBindingStyle.Document
' Create the operations for the binding.
Dim addOperationBinding As OperationBinding = _
CreateOperationBinding("Add", _
myServiceDescription.TargetNamespace)
Dim subtractOperationBinding As OperationBinding = _
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( _
GetType(System.Web.Services.Description.PortTypeCollection)) Then
' Remove the PortType at index 0.
CType(myServiceCollection, PortTypeCollection).Remove( _
myServiceDescription.PortTypes(0))
' Build a new PortType.
Dim myPortType As New PortType()
myPortType.Name = "MathServiceSoap"
' Build an AddOperation for the PortType.
Dim myAddOperation As New Operation()
myAddOperation.Name = "Add"
' Build the Input and Output messages for the Operations.
Dim myOperationInputMessage1 As New OperationInput()
Dim myXmlQualifiedName1 As New XmlQualifiedName("s0:AddSoapIn")
myOperationInputMessage1.Message = myXmlQualifiedName1
Dim myOperationOutputMessage1 As New OperationOutput()
Dim myXmlQualifiedName2 As 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.
Dim mySubtractOperation As New Operation()
mySubtractOperation.Name = "Subtract"
' Build the Input and Output messages for the operations.
Dim myOperationInputMessage2 As New OperationInput()
Dim myXmlQualifiedName3 As _
New XmlQualifiedName("s0:SubtractSoapIn")
myOperationInputMessage2.Message = myXmlQualifiedName3
Dim myOperationOutputMessage2 As New OperationOutput()
Dim myXmlQualifiedName4 As _
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)
End If
End If
End If
End Sub
Eigenschappen
| Name | Description |
|---|---|
| Capacity |
Hiermee haalt u het aantal elementen op of CollectionBase stelt u dit in. (Overgenomen van CollectionBase) |
| Count |
Hiermee haalt u het aantal elementen op dat in het CollectionBase exemplaar is opgenomen. Deze eigenschap kan niet worden overschreven. (Overgenomen van CollectionBase) |
| InnerList |
Hiermee haalt u een ArrayList met de lijst met elementen in het CollectionBase exemplaar op. (Overgenomen van CollectionBase) |
| List |
Hiermee haalt u een IList met de lijst met elementen in het CollectionBase exemplaar op. (Overgenomen van CollectionBase) |
| Table |
Hiermee haalt u een interface op waarmee de koppeling van de sleutels en waarden in de ServiceDescriptionBaseCollection. |
Methoden
| Name | Description |
|---|---|
| Clear() |
Hiermee verwijdert u alle objecten uit het CollectionBase exemplaar. Deze methode kan niet worden overschreven. (Overgenomen van CollectionBase) |
| Equals(Object) |
Bepaalt of het opgegeven object gelijk is aan het huidige object. (Overgenomen van Object) |
| GetEnumerator() |
Retourneert een enumerator die door het CollectionBase exemplaar wordt herhaald. (Overgenomen van CollectionBase) |
| GetHashCode() |
Fungeert als de standaardhashfunctie. (Overgenomen van Object) |
| GetKey(Object) |
Retourneert de naam van de sleutel die is gekoppeld aan de waarde die is doorgegeven door verwijzing. |
| GetType() |
Hiermee haalt u de Type huidige instantie op. (Overgenomen van Object) |
| MemberwiseClone() |
Hiermee maakt u een ondiepe kopie van de huidige Object. (Overgenomen van Object) |
| OnClear() |
Hiermee wist u de inhoud van het ServiceDescriptionBaseCollection exemplaar. |
| OnClearComplete() |
Voert extra aangepaste processen uit nadat de inhoud van het CollectionBase exemplaar is gewist. (Overgenomen van CollectionBase) |
| OnInsert(Int32, Object) |
Voert aanvullende aangepaste processen uit voordat u een nieuw element in het CollectionBase exemplaar invoegt. (Overgenomen van CollectionBase) |
| OnInsertComplete(Int32, Object) |
Voert extra aangepaste processen uit na het invoegen van een nieuw element in de ServiceDescriptionBaseCollection. |
| OnRemove(Int32, Object) |
Hiermee verwijdert u een element uit de ServiceDescriptionBaseCollection. |
| OnRemoveComplete(Int32, Object) |
Voert extra aangepaste processen uit nadat u een element uit het CollectionBase exemplaar hebt verwijderd. (Overgenomen van CollectionBase) |
| OnSet(Int32, Object, Object) |
Vervangt de ene waarde door een andere waarde in de ServiceDescriptionBaseCollection. |
| OnSetComplete(Int32, Object, Object) |
Voert extra aangepaste processen uit na het instellen van een waarde in het CollectionBase exemplaar. (Overgenomen van CollectionBase) |
| OnValidate(Object) |
Voert extra aangepaste processen uit bij het valideren van een waarde. (Overgenomen van CollectionBase) |
| RemoveAt(Int32) |
Hiermee verwijdert u het element in de opgegeven index van het CollectionBase exemplaar. Deze methode kan niet worden overschreven. (Overgenomen van CollectionBase) |
| SetParent(Object, Object) |
Hiermee stelt u het bovenliggende object van het ServiceDescriptionBaseCollection exemplaar in. |
| ToString() |
Retourneert een tekenreeks die het huidige object vertegenwoordigt. (Overgenomen van Object) |
Expliciete interface-implementaties
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Kopieert het hele CollectionBase naar een compatibele eendimensionale Arraywaarde, beginnend bij de opgegeven index van de doelmatrix. (Overgenomen van CollectionBase) |
| ICollection.IsSynchronized |
Hiermee wordt een waarde opgehaald die aangeeft of de toegang tot de CollectionBase synchronisatie is gesynchroniseerd (thread safe). (Overgenomen van CollectionBase) |
| ICollection.SyncRoot |
Hiermee haalt u een object op dat kan worden gebruikt om de toegang tot het CollectionBaseobject te synchroniseren. (Overgenomen van CollectionBase) |
| IList.Add(Object) |
Hiermee voegt u een object toe aan het einde van de CollectionBase. (Overgenomen van CollectionBase) |
| IList.Contains(Object) |
Bepaalt of het CollectionBase een specifiek element bevat. (Overgenomen van CollectionBase) |
| IList.IndexOf(Object) |
Zoekt naar de opgegeven Object en retourneert de op nul gebaseerde index van het eerste exemplaar binnen het hele CollectionBaseexemplaar. (Overgenomen van CollectionBase) |
| IList.Insert(Int32, Object) |
Hiermee voegt u een element in de CollectionBase opgegeven index in. (Overgenomen van CollectionBase) |
| IList.IsFixedSize |
Hiermee wordt een waarde opgehaald die aangeeft of de grootte van een CollectionBase vaste grootte is. (Overgenomen van CollectionBase) |
| IList.IsReadOnly |
Hiermee wordt een waarde opgehaald die aangeeft of het CollectionBase kenmerk Alleen-lezen is. (Overgenomen van CollectionBase) |
| IList.Item[Int32] |
Hiermee haalt u het element op de opgegeven index op of stelt u het in. (Overgenomen van CollectionBase) |
| IList.Remove(Object) |
Hiermee verwijdert u het eerste exemplaar van een specifiek object uit de CollectionBase. (Overgenomen van CollectionBase) |
Extensiemethoden
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Hiermee schakelt u parallelle uitvoering van een query in. |
| AsQueryable(IEnumerable) |
Converteert een IEnumerable naar een IQueryable. |
| Cast<TResult>(IEnumerable) |
Cast de elementen van een IEnumerable naar het opgegeven type. |
| OfType<TResult>(IEnumerable) |
Hiermee filtert u de elementen van een IEnumerable op basis van een opgegeven type. |