SPWebServiceCollection Class

Represents a collection of SPWebService objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPWebService>
    Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPWebService>
      Microsoft.SharePoint.Administration.SPWebServiceCollection

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPWebServiceCollection _
    Inherits SPPersistedChildCollection(Of SPWebService)
'Usage
Dim instance As SPWebServiceCollection
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPWebServiceCollection : SPPersistedChildCollection<SPWebService>

Remarks

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

Reference

SPWebServiceCollection Members

Microsoft.SharePoint.Administration Namespace