FormsService Class

Represents the top level entity of Microsoft Office InfoPath Forms Services.

Namespace:  Microsoft.Office.InfoPath.Server.Administration
Assembly:  Microsoft.Office.InfoPath.Server (in Microsoft.Office.InfoPath.Server.dll)

[GuidAttribute("543DD7B9-6E48-438d-86D8-000000000000")]
public sealed class FormsService : SPService

The FormsService object is an Office SharePoint Server 2007 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 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.

NoteNote

Browse for the [Microsoft.Office.InfoPath.Server] assembly at [drive]:\Program Files\Microsoft Office Servers\12.0\Bin.

Visual Basic

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

C#

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.");
    }

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

Community Additions

ADD
Show: