Export (0) Print
Expand All

FormsService class

Represents the top level entity of 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, 
	IBackupRestoreConfiguration, IBackupRestore

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.

NoteNote

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

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:
© 2014 Microsoft