Trying to get the sample to work for WmtsService - arcgis-runtime-samples-dotnet/WMTSLayer.xaml.cs at master · Esri/arcgis-runtime-samples-dotnet · Git...
// Define the Uri to the WMTS service.
Uri wmtsUri = new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS");
WmtsService myWmtsService = new WmtsService(wmtsUri);
await myWmtsService.LoadAsync();
the LoadAsync() throws and exception
I've tried various formats of the URL including ?request=GetCapabilities&service=WMTS and a different service but get the same error. Please advise.
Thanks,
Solved! Go to Solution.
We are using .Net 4.6.2 and the WmtsLayer class and WmtsService class appear to handle TLS protocol a bit different than other map layer types. We worked around this issue by specifying a TLS protocol.
in code
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls11| System.Net.SecurityProtocolType.Tls12;
or in the App.config
<runtime>
<AppContextSwitchOverrides value="Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols=false;Switch.System.Net.DontEnableSchUseStrongCrypto=false" />
</runtime>
We are using .Net 4.6.2 and the WmtsLayer class and WmtsService class appear to handle TLS protocol a bit different than other map layer types. We worked around this issue by specifying a TLS protocol.
in code
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls11| System.Net.SecurityProtocolType.Tls12;
or in the App.config
<runtime>
<AppContextSwitchOverrides value="Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols=false;Switch.System.Net.DontEnableSchUseStrongCrypto=false" />
</runtime>