How to get FeatureServerInfo

2689
7
12-09-2016 02:17 AM
EricDUCOS1
New Contributor III

Hi,

For some weeks, there was the Xamarin beta SDK that I used for accessing feature layers on a feature service stored in the ArcGIS online server.

I used the following command in my Xamarin code to get a ArcGISFeatureServiceInfo class from where I could enumerate the available layers, and also get the full extent of the set of layers:

ArcGISFeatureServiceInfo gisInfos = await ArcGISFeatureServiceInfo.CreateAsync(new Uri("http://services7.arcgis.com/...../FeatureServer"));

But with the last release of the SDK.NET, the CreateAsync method has disappeared and I did not found until now a way to retrieve this class (that still exists) from the FeatureService url.

Can someone help me resolving this problem ?

Regards.

Eric.

0 Kudos
7 Replies
dotMorten_esri
Esri Notable Contributor

ArcGISFeatureServiceInfo is no longer createable by itself. You can create s ServiceFeatureTable and load it, and it'll have the service information available on it.

0 Kudos
EricDUCOS1
New Contributor III

Hi Morten,

Sorry, but the ServiceTableInfo can only be filled by an instance of FeatureServerLayer.

So with URL like http://...../FeatureSever/xxx

If I try to initiate a ServiceTableInfo from the following url and try to LoadAsync, I get an invalid JSON error.

http://services7.arcgis.com/...../FeatureServer

One use of such url is to know for exemple how many layers are stored on the FeatureServer ? What is the extent of all the layers ? This information is available when I navigate to the URL...why cannot get map to the FeatureServiceInfo class ? Should I do the thing by hand using JSON deserializer ?

Eric.

0 Kudos
dotMorten_esri
Esri Notable Contributor

Aaah right. Sorry I misread and thought of the ArcGISFeatureServiceLayerInfo. There's currently not a way to create this type in code.

Wrt to loading server info, ie browsing the rest services to do various types of service discovery: This is on our road-map, but not currently something we had in the API.

You might want to take a look at this project which achieves that: GitHub - davetimmins/ArcGIS.PCL: Use ArcGIS Server REST resources without an official SDK. 

0 Kudos
BradleyAndrick3
New Contributor III

Morten, this was mentioned to be on the road-map. Any update on this? I would like to access the service the same way. Essentially, I just want to get information about the feature service as a whole (i.e., # of layers contained in the whole service). Is there any way to do this? Seems pretty essential, maybe I'm missing something?

Thanks,

Brad

0 Kudos
dotMorten_esri
Esri Notable Contributor

Sorry I don't have anything specifically to announce at this point. We do have the `ArcGISFeatureServiceInfo` class that represents that, but the only to create that currently is by creating a GeodatabaseSyncTask and gets its ServiceInfo property, but I think this might fail if the service doesn't support offline sync.

0 Kudos
BradleyAndrick3
New Contributor III

Thanks Morten. That is useful to know. The only other way I found was to include a second URI (or append the first) that ends in /MapService and create a ArcGISMapImageLayer and read the LayerInfos off of that. I'll see which one works best. 

0 Kudos
Jan-Tschada
Esri Contributor

Any progress on this issue? I did not find any sample how to obtain the ArcGISFeatureServiceInfo starting with a portal item representing a feature service. Our customer is querying the portal items and wanted to access the contained feature layers from the underlying feature service. There is a need for creating a ArcGISFeatureServiceInfo from portal item.

So this is still not possible with ArcGIS Runtime 100.6?

Product Manager
Developers and Location Services
Germany and Switzerland