FormTemplateCollection.VerifyFormTemplate method

Verifies that the form template can be browser-enabled.

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

public static ConverterMessageCollection VerifyFormTemplate(
	string solutionPath
)

Parameters

solutionPath
Type: System.String

The path and file name of the form template (.xsn) file.

Return value

Type: ConverterMessageCollection
A collection of messages describing the results of the form template verification.

The following examples use the VerifyFormTemplate method to verify that a form template can be uploaded to the server. The converter messages returned from the form template converter are written to the console.

    FormsService localFormsService;
    SPFarm localFarm = SPFarm.Local;
    string solutionPath = "C:\\FormTemplates\\FormTemplate.xsn";
    ConverterMessageCollection verifyMessages;
    try
    {
        localFormsService = localFarm.Services.GetValue<FormsService>(FormsService.ServiceName);
        verifyMessages = FormTemplateCollection.VerifyFormTemplate(solutionPath);
        foreach (ConverterMessage convMessage in verifyMessages)
        {
            Console.WriteLine(convMessage.ShortMessage.ToString() + ": " + convMessage.DetailedMessage.ToString());
        }
        Console.Write("Press Enter to Continue");
        Console.ReadLine();
    }
    catch (Exception ex)
    {
        Console.WriteLine("Error: " + ex.Message);
        Console.Write("Press Enter to Continue");
        Console.ReadLine();
    }
Show: