SPWebServiceCollection class

Represents a collection of SPWebService objects.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPWebServiceCollection _
	Inherits SPPersistedChildCollection(Of SPWebService)
Dim instance As SPWebServiceCollection

Use the SPWebServiceCollection constructor to return the collection of Web services within the server farm. To create a Web service, use the SPWebService to initialize the Web service object, and use the Add method to add the new object to the collection of Web services within the server farm.

Use an indexer to return a single Web service from the collection. For example, if the collection is assigned to a variable named myWebServices, use myWebServices[index] in C#, or myWebServices(index) in Visual Basic, where index is either the name or the GUID identifying the Web service.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.