Share via


SPWebServiceInstance Class

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

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.Administration.SPPersistedObject
      Microsoft.SharePoint.Administration.SPPersistedUpgradableObject
        Microsoft.SharePoint.Administration.SPServiceInstance
          Microsoft.SharePoint.Administration.SPWebServiceInstance

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

Syntax

<GuidAttribute("0244D4D3-80D6-4b31-B576-9AD89C58E083")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPWebServiceInstance _
    Inherits SPServiceInstance

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

Remarks

A Web service runs on front-end Web servers and uses Internet Information Services (IIS) Web sites to serve all SharePoint sites within all 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

Reference

SPWebServiceInstance Members

Microsoft.SharePoint.Administration Namespace