Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I wrote a desktop extension for ArcMap that allows a user to publish the map they've just created to an AGS 9.3.1 machine on another server. This works fine as long as the AGS machine acts as a SOM and a SOC. It also works if there are multiple other SOC machines in addition to the AGS machine.

However, if I go into the web manager on the AGS machine (let's call it serverA), and remove it as a host machine and specify serverB as a host/SOC machine, then the code fails when it tries to connect to the AGS instance on serverA. It says that it can't find the machine. Here is the code I'm using to connect and publish the MXD:

IServerObjectAdmin soa;
ESRI.ArcGIS.Server.IGISServerConnection connection = new ESRI.ArcGIS.Server.GISServerConnection();
connection.Connect(server);

soa = connection.ServerObjectAdmin;
IServerObjectConfiguration3 soc = (IServerObjectConfiguration3)soa.CreateConfiguration();
soc.Name = psoObject.Title;
soc.Description = psoObject.Description;
soc.StartupType = esriStartupType.esriSTAutomatic;
soc.TypeName = "MapServer";

soc.IsPooled = true;
IPropertySet props = psoObject.AGSConfigPropertySet(soc);
soc.Properties = props;

soc.MinInstances = Convert.ToInt32(props.GetProperty("MinInstances").ToString());
soc.MaxInstances = Convert.ToInt32(props.GetProperty("MaxInstances").ToString());

soa.AddConfiguration(soc);
soa.StartConfiguration(soc.Name, soc.TypeName);
IServerMachine machine = soa.GetMachine(server);
soa.UpdateMachine(machine);
share|improve this question

closed as off-topic by PolyGeo, BradHards, Paul, Curlew, Jason Scheirer Oct 12 '13 at 19:00

  • This question does not appear to be about geographic information systems within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Are you able to add a service with the Server Manager web app when the SOM machine has no SOC running on it? –  Kirk Kuykendall Feb 14 '12 at 15:38
    
Yes, I can successfully add a new service manually through the web manager when the AGS machine has been removed as a host machine. –  Brad Feb 14 '12 at 15:50
    
Have you tried IGISServerConnection2.Connect2 with a specific user as described here? –  Kirk Kuykendall Feb 14 '12 at 16:16
4  
This question appears to be abandoned because it has had no activity for 18 months and its asker has not logged into the site for 18 months. Consequently, I propose that it be closed. –  PolyGeo Oct 12 '13 at 6:39
add comment