It's not particularly simple - it's not HARD, but you will have to write a service and a listener.
In a nutshell, you need a service running somewhere that has a connection to Vault and an instance of the Webservice manager. You service is going to implement System.ServiceModel.ServiceBase, it's going to get a connection the the WebServiceManager and then pass off to an implementation of System.ServiceModel.ServiceHost . WebServiceManager is going to toss out the FileEvents and FolderEvents, you just catch them in your particular implementation and do something with them. Note that your actual implementation doesn't particularly need to live on the server that ADMS is running on, your implementation just needs to live somewhere that it can access the webservice manager. Our particular implementation runs in a tray app on our users workstations, gets a connection, and just listens and does stuff based on the events we have configured. Here is a sample interface you can reference:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.Runtime.Serialization;
namespace VaultInterfaceEntities {
[ServiceContract]
public interface IVaultIntercept {
[OperationContract]
EventResult FileEvent(string vaultserver, string vaultname, string user, EventType eventtype, InterceptEvent ievent, long[] targetids, long parent);
[OperationContract]
EventResult FolderEvent(string vaultserver, string vaultname, string user, EventType eventtype, InterceptEvent ievent, long[] targetids, long parent);
[OperationContract(IsOneWay = true)]
void UserEvent(string user, string machine, UserInterceptEvent uevent);
[OperationContract]
IEnumerable<Restriction> FindRestrictions(string vaultserver, string vaultname, string user, RestrictionType restrictionType, InterceptEvent ievent, long[] targetids, long parent);
}
[DataContract]
public enum UserInterceptEvent {
[EnumMember]
Connect,
[EnumMember]
Disconnect
}
[DataContract]
public enum RestrictionType {
[EnumMember]
File,
[EnumMember]
Folder
}
[DataContract]
public class Restriction {
[DataMember]
public string Id { get; set; }
[DataMember]
public string ObjectName { get; set; }
[DataMember]
public string Message { get; set; }
}
[DataContract]
public enum EventType {
[EnumMember]
Pre,
[EnumMember]
Post
}
/// <summary>
/// File and Folder event types
/// File Event Types:
/// most of the file events use the File Master Id but some use the File Id
/// </summary>
[DataContract]
public enum InterceptEvent {
/// <summary>
///File event targetids are File Master Id
/// </summary>
[EnumMember]
Add,
/// <summary>
///File event targetids are File Master Id
/// </summary>
[EnumMember]
Delete,
/// <summary>
///File event targetids are File Id
/// </summary>
[EnumMember]
Acquire,
/// <summary>
///File event targetids are File Master Id
/// </summary>
[EnumMember]
CheckIn,
/// <summary>
///File event targetids are File Id
/// </summary>
[EnumMember]
Checkout,
/// <summary>
///File event targetids are File Master Id
/// </summary>
[EnumMember]
StateChange,
/// <summary>
/// File event targetid is File Master Id, parent is the destination folder
/// </summary>
[EnumMember]
Move,
/// <summary>
/// File event targetids are the File Id, parent is always 0
/// </summary>
[EnumMember]
Download
};
[DataContract]
public class EventResult {
[DataMember]
public bool Success { get; set; }
[DataMember]
public string Message { get; set; }
}
}
May not be exactly what you need but hopefully it gets you in the ballpark.