FormsService class
Represents the top level entity of InfoPath Forms Services.
Microsoft.SharePoint.Administration.SPAutoSerializingObject
Microsoft.SharePoint.Administration.SPPersistedObject
Microsoft.SharePoint.Administration.SPPersistedUpgradableObject
Microsoft.SharePoint.Administration.SPService
Microsoft.Office.InfoPath.Server.Administration.FormsService
Assembly: Microsoft.Office.InfoPath.Server (in Microsoft.Office.InfoPath.Server.dll)
The FormsService object is an SharePoint Server 2010 shared service provider that extends the SPService object. Like all shared service providers, it is load-balanced and runs at the farm level. There is only one instance of the forms service per farm.
The following code example writes the forms service status to the console that the forms service is not available. References are required in the Visual Studio project to the [Microsoft.Office.Server], the [Microsoft.Office.InfoPath.Server], and the [Microsoft.SharePoint] assemblies.
Note
|
|---|
Browse for the [Microsoft.Office.InfoPath.Server] assembly at [drive]:\Program Files\Microsoft Office Servers\14.0\Bin. |
For the example to work, Import statements are required for the
Microsoft.Office.Server, the Microsoft.Office.InfoPath.Server.Administration, and the Microsoft.SharePoint.Administration namespaces.
Dim LocalFormsService As FormsService
Try
LocalFormsService = SPFarm.Local.Services.GetValue(Of FormsService)(FormsService.ServiceName)
Console.WriteLine(LocalFormsService.Status.ToString())
Catch ex As Exception
Console.WriteLine("The forms service is not provisioned.")
End Try
For the example to work, using statements are required for the
Microsoft.Office.Server, the Microsoft.Office.InfoPath.Server.Administration, and the Microsoft.SharePoint.Administration namespaces.
FormsService localFormsService;
try
{
localFormsService = SPFarm.Local.Services.GetValue<FormsService>(FormsService.ServiceName);
Console.WriteLine(localFormsService.Status.ToString());
}
Catch (Exception ex)
{
Console.WriteLine("The forms service is not provisioned.");
}
Note