Select to view content in your preferred language

GISServerConnection Fails in ArcGIS Server 10.2.2 SOE

1902
1
05-17-2014 08:17 AM
MeleKoneya
Frequent Contributor
We are in the process of upgrading our ArcGIS Server to 10.2.2. We have an SOE for printing high quality maps. As part of the SOE we connect to the server and get the Map Services and the layer information for each.
The code below fails at conn.Connect(server);

Please provide guidance as to how we can connect to our server with our SOE in 10.2 and get the map services and layer information. 

Thanks,

Mele

{
GISServerConnection conn = null; 

IServerObjectAdmin7 soa = null 



conn = new GISServerConnection(); conn.Connect(server); 

soa = (IServerObjectAdmin7)conn.ServerObjectAdmin; 

IEnumServerObjectConfiguration enumconfig = soa.GetConfigurations(); 


IServerObjectConfiguration config = enumconfig.Next(); 

config.WaitTimeout = 600; 



while (config != null) 
 
{ 
 
//Check to see service is started and not the service with the LIS_Print SOE capability 
  IServerObjectConfigurationStatus configStatus = soa.GetConfigurationStatus(config.Name, config.TypeName); 

  if (config.Name != serverObjectHelper.ServerObject.ConfigurationName && configStatus.Status == esriConfigurationStatus.esriCSStarted) 
   { if (config.TypeName == "MapServer") { IServerObjectManager4 som = (IServerObjectManager4)conn.ServerObjectManager; 
   IServerContext serverContext = som.CreateServerContext(config.Name, "MapServer");    IServerObject serverObject = serverContext.ServerObject; 

IMapServer3 mapServer =    (IMapServer3)serverObject; 
 GetMapLayerSettings(mapServer, config.Name); 
 serverContext.ReleaseContext(); 
 } 
 } 
 config = enumconfig.Next(); 
}
0 Kudos
1 Reply
nicogis
MVP Frequent Contributor

At 10.1, you can no longer use ArcObjects remotely (via DCOM); this way of interacting with ArcGIS for Server is no longer supported. If you are using GISServerConnection in the Server library or AGSServerConnection in the GISClient library in your code, these need to be removed if you are working with ArcGIS 10.1 for Server

see GISClient: ArcObjects Help for .NET developers