Unable to load hosted tiled layer in WPF

173
0
01-24-2024 06:18 AM
Labels (2)
CharlesSanvido
New Contributor

We publish a hosted tiled layer service in our ArcGIS Portal 11.1 and try to integrate in one of our in-house software is the .Net SDK (WPF).  We use the following example

https://developers.arcgis.com/net/wpf/sample-code/arcgis-tiled-layer/

At first we test with the foloowing code using the ArcGIS Online service

            // Test ArcGIS tile layer
            // Create uri to the tiled service
            Uri serviceUri = new Uri(
               "https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer");
            // Create new tiled layer from the url
            ArcGISTiledLayer imageLayer = new ArcGISTiledLayer(serviceUri);
            // Add the layer to the base map
            MyMapView.Map.Basemap.BaseLayers.Add(imageLayer);

Then we change for url of our hosted tiled layer service (server name and  service have been redacted )

            // Test ArcGIS tile layer
 
           // Create uri to the tiled service
            Uri serviceUri = new Uri(
                "https://<my server>/server/rest/services/Hosted/<my layer service name>/MapServer");
            // Create new tiled layer from the url
            ArcGISTiledLayer imageLayer = new ArcGISTiledLayer(serviceUri);
            // Add the layer to the base map
            MyMapView.Map.Basemap.BaseLayers.Add(imageLayer);

With the above code a Credentials Rrequired popup is shown asking for username/password.  The Portal and Server are configured to use Integrated Windows Authetification (IWA).  We try with uUsername, domain\username, User Principal Name but never got any tiled loaded.  All other ressrouces (web map, features layer, image layer) are loading correctly, only the hosted tiled layer not working.

In the IIS log only the initial requests without credential for each tile are receive returning the initial HTTP 401 Unauthorized.

2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/364/302 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/366/300 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/365/302 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/365/301 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/366/302 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/365/303 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/367/303 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/366/301 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/364/301 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/366/303 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17
2024-01-22 13:43:14 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/367/301 - 443 - 192.xxx.xxx.xxx ArcGISRuntime-NET/200.2+(Windows+10.0.19045;+Win64;+.NET6.0.21) http://myapp.app/ 401 2 5 17

Accessing the same url using a browser in incognito mode prompt the credential required, but after provinding username/password load correctly the tile and we see the 2 requests in the IIS side.

2024-01-22 19:16:06 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/367/303 - 443 - 192.xxx.xxx.xxx Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/120.0.0.0+Safari/537.36+Edg/120.0.0.0 https://<my server>/server/rest/services/Hosted/<my layer service name>/MapServer?f=jsapi 401 2 5 15
2024-01-22 19:16:06 10.xxx.xxx.xxx GET /server/rest/services/Hosted/<my layer service name>/MapServer/tile/10/365/303 - 443 <domain>\<user> 192.xxx.xxx.xxx Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/120.0.0.0+Safari/537.36+Edg/120.0.0.0 https://<my server>/server/rest/services/Hosted/<my layer service name>/MapServer?f=jsapi 200 0 0 31

The first request is provided without credentila (HTTP 401 is returned), then a request with credential is send and the tile image is returned (HTTP 200).

Application users have been created in ArcGIS user datastore and are able to access the tiled layer in the Portal and access the service using a brower.  The application is able to correctly resquest data for other type of ressources and even tiled layer when it is not hosted.

What can cause the external software to not be able to get the hosted tiled layer dat via service exposed by our internal ArcGIS server?

0 Kudos
0 Replies