After some more trial-and-error coding, I found a set of properties that enables REST capabilities to work successfully. I've highlighted the 4 properties that, from a rudimentary test, appear to be required for REST. None of these 4 properties were documented in any developer help. What I did was look through a well-formed cfg file that was produced as a result of creating a successful REST map service via ArcMap toolbar. It would be nice if a developer sample or other documentation was included in the ArcGIS Server SDK to show how to publish a map service programmatically AND enable REST capabilities programmatically. The missing link to the fully-automated solution is clearing the REST cache programmatically; it looks like this capability is available at 10. serverObjConfig = null;
//create map server object
serverObjConfig = (IServerObjectConfiguration3)this.soAdmin.CreateConfiguration();
serverObjConfig.Name = newMapServiceName;
serverObjConfig.Description = newMapServiceDescription;
serverObjConfig.TypeName = "MapServer";
serverObjConfig.IsPooled = true;
serverObjConfig.MinInstances = 1;
serverObjConfig.MaxInstances = 1;
serverObjConfig.WaitTimeout = 10;
serverObjConfig.UsageTimeout = 120;
serverObjConfig.IsolationLevel = esriServerIsolationLevel.esriServerIsolationHigh;
//root serverobjectconfiguration props
ESRI.ArcGIS.esriSystem.IPropertySet2 propSet;
propSet = (ESRI.ArcGIS.esriSystem.IPropertySet2)serverObjConfig.Properties;
propSet.SetProperty("FilePath", mxdFileName);
propSet.SetProperty("SupportedImageReturnTypes", "URL");
propSet.SetProperty("OutputDir", "c:\\arcgisserver\\arcgisoutput");
propSet.SetProperty("VirtualOutputDir", "http://***********/arcgisoutput/");
propSet.SetProperty("MaxImageHeight", "2048");
propSet.SetProperty("MaxRecordCount","500");
propSet.SetProperty("MaxBufferCount", "100");
propSet.SetProperty("MaxImageWidth", "2048");
propSet.SetProperty("IsCached", "false");
propSet.SetProperty("CacheOnDemand", "false");
propSet.SetProperty("IgnoreCache", "false");
propSet.SetProperty("ClientCachingAllowed", "true");
//recycling properties
IPropertySet2 recyclingSet = (IPropertySet2)serverObjConfig.RecycleProperties;
recyclingSet.SetProperty("StartTime", "00:00");
recyclingSet.SetProperty("Interval", "86400");
//enable web access
ESRI.ArcGIS.esriSystem.IPropertySet2 infoSet;
infoSet = (ESRI.ArcGIS.esriSystem.IPropertySet2)serverObjConfig.Info;
infoSet.SetProperty("WebEnabled", "true");
infoSet.SetProperty("WebCapabilities", "Map,Query,Data");