App accessing MapServer instead of FeatureServer

1717
8
Jump to solution
04-22-2020 12:33 PM
GilroyD_silva
New Contributor II

I am writing an app using AppStudio for ArcGIS. The app accesses a FeatureServer and allows the user to add, move or delete features. The app works fine when I use it. The featureserver is loaded using a ServiceFeatureTable and a url to the feature service.

However, when other users use the app, I see errors in the ArcGIS Server manager log that look like the app is trying to access the MapServer instead of the FeatureServer. So the features are not showing up on the map. The user has permission to access the FeatureServer but not the MapServer. After giving the user access to the MapServer, the features show up on the map. But when the user tries to edit a feature, an error shows up in the log saying "the requested capability is not supported" because it is trying to edit the MapServer not the FeatureServer.

Any idea why it is accessing the MapServer instead of the FeatureServer for other users?

0 Kudos
1 Solution

Accepted Solutions
GilroyD_silva
New Contributor II

Hello Erwin,

I found the solution to the problem. I was using a user of type "Viewer" to do the edits to the feature layer. After changing the user type to "Creator" the app worked fine. However, it was confusing seeing errors in the log that said the MapServer was being edited. And I am still not sure why it worked from AppStudio when the user was of type Viewer.

Thank you for your help.

Gilroy

View solution in original post

8 Replies
ErwinSoekianto
Esri Regular Contributor

Gilroy,

Is this a custom app or one of AppStudio templates? 

Technically, it should not, for editing and feature interaction, it should access the feature service, and for displaying on the map it should use map service. Maybe you are using both in your app? Are they from different ArcGIS Server and/or have different security access? 

Maybe if you can share some snippets of the code so that we can see what's wrong. 

Erwin

0 Kudos
GilroyD_silva
New Contributor II

This is an app I created by modifying the Add & Delete features sample. The app does not contain any url for the MapServer. It only has the url for the FeatureServer.

Here is a snippet for the ServiceFeatureTable:

               // declare as child of feature layer, as featureTable is the default property
                ServiceFeatureTable {
                    id: featureTable

                                            url: app.info.propertyValue("hydrantUrl", "")  //This is the url to the featureserver

                    // make sure edits are successfully applied to the service
                    onApplyEditsStatusChanged: {
                        if (applyEditsStatus === Enums.TaskStatusCompleted) {
                            console.log("successfully added feature");
                        }
                    }
                    // signal handler for the asynchronous addFeature method
                    onAddFeatureStatusChanged: {
                        if (addFeatureStatus === Enums.TaskStatusCompleted) {
                            // apply the edits to the service
                            featureTable.applyEdits();
                        }
                    }
                }
            }
This is the error in the Server manager log before giving the user access to the MapServer.
At this time the user had access only to the FeatureServer. 
WARNINGApr 21, 2020, 12:13:19 PMA request was made for service 'PropertyFacts/PropertyFactsHydrantsEdit.MapServer' but it did not have adequate credentials.Admin

This is the error in the Server Manager Log after giving the user access to the MapServer.

SEVEREApr 22, 2020, 11:55:12 AMThe requested capability is not supported.PropertyFacts/PropertyFactsHydrantsEdit.MapServer17127applyEdits
0 Kudos
GilroyD_silva
New Contributor II

I created a scaled down version of the app with credentials to access the feature layer hard-coded in the app (credentials of another user, not mine, who is part of the group that has access to the feature service). I noticed that when I run the app through AppStudio on my desktop, the app works fine and I can edit features and the changes are saved. But after uploading the app through AppStudio and running it through AppStudio player from my smartphone, the edits are not being saved and the errors show up in the log that says that the capability is not supported and the source of the error is the MapServer not the FeatureServer.

Any idea as to why this is happening? What am I doing wrong?

Gilroy

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Gilroy, 

I see, there is a chance that this could be related to ArcGIS Runtime License. What Runtime license are you using in your app when running using AppRun in your desktop? 

When running the app inside the AppStudio Player, can you check the Runtime License setting set on the App Setting? Note: You need to enable "Developer Mode" to enable the Runtime license setting. 

Thank you,

Erwin

0 Kudos
GilroyD_silva
New Contributor II

Hi Erwin,

I have a basic runtime license.

I removed the license key from the AppSettings in AppStudio and I uploaded the app again. I changed the settings in AppStudio Player to use the ArcGIS Runtime Developer Mode license and restarted the player.

When running the app, I see the "license for developer use" watermark. But the application does not save the edit. And I still get the same error in server manager log.

Any idea why it is trying to edit MapServer instead of the FeatureServer?

Gilroy

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Gilroy, 

Using Basic runtime license is what you need to do editing. And "developer license" can do everything, I don't think this is related to licensing then. 

Regarding the issue with editing the MapServer instead of the FeatureServer, it is a weird issue, it should not happen. How old is the feature layer? What is the version of the ArcGIS Server or Enterprise it is running on? 

Are you at liberty to share the feature layer for us to test it in-house? If not, this looks like something that Esri Technical Support‌ can help with and troubleshoot it further. 

Thank you,

Erwin.

0 Kudos
GilroyD_silva
New Contributor II

Hello Erwin,

I found the solution to the problem. I was using a user of type "Viewer" to do the edits to the feature layer. After changing the user type to "Creator" the app worked fine. However, it was confusing seeing errors in the log that said the MapServer was being edited. And I am still not sure why it worked from AppStudio when the user was of type Viewer.

Thank you for your help.

Gilroy

ErwinSoekianto
Esri Regular Contributor

Glad it worked out. And thank you for sharing the solution. We are going keep an eye for this issue, to see why there is different behavior between the AppRun and AppStudio Player.  

0 Kudos