This documentation is archived and is not being maintained.

ServiceDescription.Services Property

Gets the collection of Service instances contained in the ServiceDescription.

[Visual Basic]
Public ReadOnly Property Services As ServiceCollection
[C#]
public ServiceCollection Services {get;}
[C++]
public: __property ServiceCollection* get_Services();
[JScript]
public function get Services() : ServiceCollection;

Property Value

Returns a ServiceCollection.

Remarks

The ServiceCollection returned by this property corresponds to the list of <service> 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/.

Example

[Visual Basic] 
' Read a ServiceDescription from existing WSDL.
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read("Input.vb.wsdl")
myServiceDescription.TargetNamespace = "http://tempuri.org/"

' Get the ServiceCollection of the ServiceDescription.
Dim myServiceCollection As ServiceCollection = _
   myServiceDescription.Services

' Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services.Item(0))

[C#] 
// Read a ServiceDescription from existing WSDL.
ServiceDescription myServiceDescription =
   ServiceDescription.Read("Input_CS.wsdl");
myServiceDescription.TargetNamespace = "http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection myServiceCollection = myServiceDescription.Services;

// Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services[0]);

[C++] 
// Read a ServiceDescription from existing WSDL.
ServiceDescription* myServiceDescription =
   ServiceDescription::Read(S"Input_CS.wsdl");
myServiceDescription->TargetNamespace = S"http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection* myServiceCollection = myServiceDescription->Services;

// Remove the Service at index 0 of the collection.
myServiceCollection->Remove(myServiceDescription->Services->Item[0]);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ServiceDescription Class | ServiceDescription Members | System.Web.Services.Description Namespace

Show: