Click or drag to resize

IVssBackupComponentsSaveAsXml Method

The SaveAsXml method saves the Backup Components Document containing a requester's state information to a specified string. This XML document, which contains the Backup Components Document, should always be securely saved as part of a backup operation.

Namespace:  Alphaleonis.Win32.Vss
Assembly:  AlphaVSS.Common (in AlphaVSS.Common.dll) Version: (
string SaveAsXml()

Return Value

Type: String
The Backup Components Document containing a requester's state information.
OutOfMemoryExceptionOut of memory or other system resources.
SystemExceptionUnexpected VSS system error. The error code is logged in the event log.
VssBadStateExceptionThe backup components object is not initialized, this method has been called during a restore operation, or this method has not been called within the correct sequence.

For a typical backup operation, SaveAsXml should not be called until after both writers and the requester are finished modifying the Backup Components Document.

Writers can continue to modify the Backup Components Document until their successful return from handling the PostSnapshot event (CVssWriter::OnPostSnapshot), or equivalently upon the completion of DoSnapshotSet.

Requesters will need to continue to modify the Backup Components Document as the backup progresses. In particular, a requester will store a component-by-component record of the success or failure of the backup through calls to the SetBackupSucceeded(Guid, Guid, VssComponentType, String, String, Boolean) method.

Once the requester has finished modifying the Backup Components Document, the requester should use SaveAsXml to save a copy of the document to the backup media.

A Backup Components Document can be saved at earlier points in the life cycle of a backup operation, for instance, to support the generation of transportable shadow copies to be handled on remote machines.

However, SaveAsXml should never be called prior to PrepareForBackup, because the Backup Components Document will not have been filled by the requester and the writers.

See Also