We have a requirement to be able to connect to a feature layer hosted in enterprise SDE server.
The user will load the layer on demand.
There is some documentation on connecting to SDE layers but not really.
WorkspaceInfo.CreateSDEConnection Method (String, String)
How can we do this?
I did find this post:
ArcSDE and Runtime 10.1.1
Where they tried to connect but were not successful.
The example code in the above link is:
```
- final WorkspaceInfo info = WorkspaceInfo.CreateSDEConnection("test", "feature.sde");
-
- // try to create a new feature service using the blank map pack
- final LocalFeatureService lfs = new LocalFeatureService("mpk_blank.mpk");
- lfs.getDynamicWorkspaces().add(info);
- lfs.start();
-
- // create a feature layer using the local service
- final ArcGISFeatureLayer layer = new ArcGISFeatureLayer(lfs.getUrlFeatureService());
```
But it does not show how to specify a layer to display.
I don't need write access to the layer just read access.
Creating a MPK file and adding it there is not sufficient.
Just need a example to provide a absolute path to a sde layer and add to the map.