MapServer object in ArcGIS 10.1

711
3
01-30-2013 11:57 PM
JojiGeorge
New Contributor
How to get MapServer object in ArcGIS 10.1?

In ArcGIS 10 I used the following code.
..........................
MapServer mapServer = (MapServer) context.getServerObject();
IMap map = mapServer.getMap(mapServer.getDefaultMapName());
IEnumLayer maplayers = map.getLayers(null, true);
............................
0 Kudos
3 Replies
nicogis
MVP Frequent Contributor
In 10.1 you can use this code if you can connect ags 10 but if you connect to 10.1 ags dcom connection has been remove.
What do you do in details?
0 Kudos
JojiGeorge
New Contributor
In 10.1 you can use this code if you can connect ags 10 but if you connect with to 10.1 ags has been remove dcom connection.
What do you do in details?


Actually am adding feature to Featurelayer.

Its works fine in ags 10

IFeatureCursor featureCursor = new IFeatureCursorProxy(featureClass.IFeatureClass_insert(true));
IPoint point = new IPointProxy(context.createObject(Point.getClsid()));
point.setX(pointX);
point.setY(pointY);
featureBuffer.setShapeByRef(point);
featureCursor.insertFeature(featureBuffer);
0 Kudos
RichardWatson
Frequent Contributor
As communicated in private email, if you want to access ArcObjects then you have write an SOE.

An alternative is to use the published REST API to do what you need.  For example, perhaps the feature service has what you need.
0 Kudos