Select to view content in your preferred language

SOI get data source

576
1
03-26-2018 05:23 AM
MatejSkerjanc
Occasional Contributor

Hello 

is it possible to get data source (i.e. table name) during HandleRESTRequest 

i have access to the following 

private string _soiName;
private IServerObjectHelper _soHelper;
private ServerLogger _serverLog;
private RestSOIHelper _restSOIHelper;
private IMapServerDataAccess mapServerDataAccess;
private IMapLayerInfos layerInfos;
private IFeatureClass layerData;
private IMapServer3 ms;

private List<IMapLayerInfo> iInfos;

_soHelper = pSOH;
_serverLog = new ServerLogger();
_restSOIHelper = new RestSOIHelper(pSOH);

this.mapServerDataAccess = (IMapServerDataAccess)_soHelper.ServerObject;
this.ms = (IMapServer3)this.mapServerDataAccess;
IMapServerInfo mapServerInfo = ms.GetServerInfo(ms.DefaultMapName);

this.layerInfos = mapServerInfo.MapLayerInfos;

iInfos = new List<IMapLayerInfo>();
for (int i = 0; i < this.layerInfos.Count; i++)
{
IMapLayerInfo layer = layerInfos.get_Element(i);
this.iInfos.Add(layer);
}

So i have mapserverdataAccess, layerinfos, imaplayerinfo, mapserver, ifeatureclass. 

Is it possible to get data source of these? I've tried everything to my limited arcobjects knowledge to no avail.

Help is appreciated

best regards, Matej

0 Kudos
1 Reply
Amir-Sarrafzadeh-Arasi
Occasional Contributor

Dear MatejSkerjanc,

yes it is possible to get name and other information of table or featurelayers of the mapservice,

what you should do, first you should create the mapservice object then get the information from that object.

 

IMapServerDataAccess mapServerDataAccess = (IMapServerDataAccess) this.so;
ms = (IMapServer) mapServerDataAccess;

String table_name = ms.getServerInfo(ms.getDefaultMapName()).getName();

I hope this work for you.

If you need more clarification you can make contact with me.

amir@wheretech.it

Amir Sarrafzadeh Arasi
0 Kudos