Quick Start (Base64): Entering backup mode using the web service API

The following C# code example enters into backup mode with a unique label for two hours. After the backup time expires or if backup mode is explicitly exited, the LiveCycle Server returns to purging files from the Global Document Storage. (See Entering Backup Mode on the LiveCycle server.)

/* 
    * Ensure that you create a .NET client assembly that uses  
    * base64 encoding. This is required to populate a BLOB  
    * object with data or retrieve data from a BLOB object. 
    *  
    * For information, see "Creating a .NET client assembly" in Programming with LiveCycle.   
    */ 
using System; 
using System.Collections.Generic; 
using System.Collections; 
using System.ComponentModel; 
using System.Data; 
using System.Text; 
 
namespace BackupRestore 
{ 
       class BackupRestoreEnter 
       { 
           [STAThread] 
           static void Main(string[] args) 
           { 
               try 
               { 
                   BackupServiceService myBackup = new BackupServiceService(); 
                   myBackup.Credentials = new System.Net.NetworkCredential("administrator", "password"); 
 
                   // Specify a generic label, 120 minutes to perform the backup,  
        // and not to provide continous backup mode coverage (used for snapshot backups)  
                   String uniqueLabel = "BackupRestoreTake1"; 
                   Int32 timeToBackup = 120; 
                   Boolean continousBackupMode = false; 
                   //Enter backup mode. 
                   BackupModeEntryResult backupResult = myBackup.enterBackupMode(uniqueLabel, timeToBackup, continousBackupMode); 
 
                   //Retrieve the results of entering backup mode 
                   if (backupResult != null) 
                   { 
                       Console.WriteLine("Start time is: " + backupResult.startTime); 
                       Console.WriteLine("Backup Current ID is: " + backupResult.id); 
                       Console.WriteLine("Backup Previous ID is: " + backupResult.previousReservationId); 
                       Console.WriteLine("Backup Label is: " + backupResult.label); 
                       Console.WriteLine("Backup Time to complete is: " + backupResult.reservationTimeout); 
                   } 
                   else 
                   { 
                       Console.WriteLine("Could not enter backup mode on the LiveCycle server"); 
                   } 
               } 
               catch (Exception ee) 
               { 
                   Console.WriteLine(ee.Message); 
               } 
           } 
       } 
}