SPWebServiceCollection class

Represents a collection of SPWebService objects.

Inheritance hierarchy


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
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPWebServiceCollection : SPPersistedChildCollection<SPWebService>


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.

Thread safety

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

See also


SPWebServiceCollection members

Microsoft.SharePoint.Administration namespace