This documentation is archived and is not being maintained.
ServiceDescriptionCollection Class
Visual Studio 2008
Represents a collection of instances of the ServiceDescription class. This class cannot be inherited.
Assembly: System.Web.Services (in System.Web.Services.dll)
#using <System.Web.Services.dll> #using <System.Xml.dll> using namespace System; using namespace System::Xml; using namespace System::Web::Services::Description; int main() { try { // Get ServiceDescription objects. ServiceDescription^ myServiceDescription1 = ServiceDescription::Read( "DataTypes_cpp.wsdl" ); ServiceDescription^ myServiceDescription2 = ServiceDescription::Read( "MathService_cpp.wsdl" ); // Set the names of the ServiceDescriptions. myServiceDescription1->Name = "DataTypes"; myServiceDescription2->Name = "MathService"; // Create a ServiceDescriptionCollection. ServiceDescriptionCollection^ myServiceDescriptionCollection = gcnew ServiceDescriptionCollection; // Add the ServiceDescriptions to the collection. myServiceDescriptionCollection->Add( myServiceDescription1 ); myServiceDescriptionCollection->Add( myServiceDescription2 ); // Display the elements of the collection using the Item property. Console::WriteLine( "Elements in the collection: " ); for ( int i = 0; i < myServiceDescriptionCollection->Count; i++ ) Console::WriteLine( myServiceDescriptionCollection[ i ]->Name ); // Construct an XML qualified name. XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "MathServiceSoap","http://tempuri2.org/" ); // Get the Binding from the collection. Binding^ myBinding = myServiceDescriptionCollection->GetBinding( myXmlQualifiedName ); Console::WriteLine( "Binding found in collection with name: {0}", myBinding->ServiceDescription->Name ); } catch ( Exception^ e ) { Console::WriteLine( "The following exception was raised: {0}", e->Message ); } }
#using <mscorlib.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::Xml;
using namespace System::Web::Services::Description;
int main()
{
try
{
// Get ServiceDescription objects.
ServiceDescription* myServiceDescription1 =
ServiceDescription::Read(S"DataTypes_cpp.wsdl");
ServiceDescription* myServiceDescription2 =
ServiceDescription::Read(S"MathService_cpp.wsdl");
// Set the names of the ServiceDescriptions.
myServiceDescription1->Name = S"DataTypes";
myServiceDescription2->Name = S"MathService";
// Create a ServiceDescriptionCollection.
ServiceDescriptionCollection* myServiceDescriptionCollection =
new ServiceDescriptionCollection();
// Add the ServiceDescriptions to the collection.
myServiceDescriptionCollection->Add(myServiceDescription1);
myServiceDescriptionCollection->Add(myServiceDescription2);
// Display the elements of the collection using the Item property.
Console::WriteLine(S"Elements in the collection: ");
for (int i=0; i<myServiceDescriptionCollection->Count; i++)
Console::WriteLine(myServiceDescriptionCollection->Item[i]->Name);
// Construct an XML qualified name.
XmlQualifiedName* myXmlQualifiedName =
new XmlQualifiedName(S"MathServiceSoap", S"http://tempuri2.org/");
// Get the Binding from the collection.
Binding* myBinding =
myServiceDescriptionCollection->GetBinding(myXmlQualifiedName);
Console::WriteLine(S"Binding found in collection with name: {0}",
myBinding->ServiceDescription->Name);
}
catch (Exception* e)
{
Console::WriteLine(S"The following exception was raised: {0}", e->Message);
}
}
System::Object
System.Collections::CollectionBase
System.Web.Services.Description::ServiceDescriptionBaseCollection
System.Web.Services.Description::ServiceDescriptionCollection
System.Collections::CollectionBase
System.Web.Services.Description::ServiceDescriptionBaseCollection
System.Web.Services.Description::ServiceDescriptionCollection
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.
Show: