SPWebServiceInstance class

Represents an instance of a SharePoint Foundation Web service running on a particular server.

Inheritance hierarchy


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


<GuidAttribute("0244D4D3-80D6-4b31-B576-9AD89C58E083")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPWebServiceInstance _
    Inherits SPServiceInstance
Dim instance As SPWebServiceInstance
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPWebServiceInstance : SPServiceInstance


A Web service runs on front-end Web servers and uses Internet Information Services (IIS) Web sites to serve HTTP requests for the SharePoint applications in the service.

Use the inherited Instances property of the SPWebService class to return an SPServiceInstanceDependencyCollection object that represents all instances of the Web service. To return the current Web service instance, use the LocalContent property. To access the collection of Web service instances that run on a specific server, use the SPWebServiceInstanceCollection constructor.

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

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


SPWebServiceInstance members

Microsoft.SharePoint.Administration namespace