We have to connect ArcGIS Server using ArcObjects 10.3? and we are not able to find server objects for making connection.
We are using following code for your reference
GISServerConnection serverConnection = new GISServerConnection();
serverConnection.Connect("localhost");
using above mentioned code, we want to access all the map services hosted on the server.
Hi
This is ArcObjects question.
This code works for me:
IPropertySet propertySet = new PropertySetClass(); string agsUrl = "http://mody-pc:6080/arcgis/services"; string serviceName = "MosaicMap"; propertySet.SetProperty("url", agsUrl); //Open an AGS connection. Type factoryType = Type.GetTypeFromProgID("esriGISClient.AGSServerConnectionFactory"); IAGSServerConnectionFactory agsFactory = (IAGSServerConnectionFactory)Activator.CreateInstance(factoryType); IAGSServerConnection agsConnection = agsFactory.Open(propertySet, 0); IName pName = null; IAGSEnumServerObjectName agsServerObjectNames = agsConnection.ServerObjectNames; agsServerObjectNames.Reset(); IAGSServerObjectName agsServerObjectName = agsServerObjectNames.Next(); while (agsServerObjectName != null) { if (agsServerObjectName.Type == "MapServer") { pName = (IName)agsServerObjectName; IAGSServerObject agsServerObject = (IAGSServerObject)pName.Open(); // do something } agsServerObjectName = agsServerObjectNames.Next(); }