Select to view content in your preferred language

Issue with Loading WMSLayer in .NET MAUI Application: Misused Header Name 'Content-Encoding'

214
3
Jump to solution
4 weeks ago
MaxPower
New Contributor II

Hello,

I am experiencing an issue while trying to load a WMS layer in my .NET MAUI application using the ArcGIS Runtime SDK. The WMS layer works fine on iOS, but on Android and WinUI, I encounter the following error:

Misused header name, 'Content-Encoding'. Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage, and content headers with HttpContent objects.

 

Here is the code snippet I am using to load the WMS layer:

private async Task<WmsLayer> GetWMSLayer(WMS wMS)
{
try
{
WmsLayer myWmsLayer = new(new Uri(wMS.url), new List<string> { wMS.layername });

await myWmsLayer.LoadAsync();
return myWmsLayer;
}
catch (Exception ex)
{
await Application.Current.MainPage.DisplayAlert("Error", ex.ToString(), "OK");
}
return null;
}

 

The WMS layer URL is: https://geo4.service24.rlp.de/wms/rp_dop40.fcgi

Layer name: rp_dop40

I have ensured that all NuGet packages are up to date. However, the issue persists. Any guidance on resolving this issue would be greatly appreciated.

Thank you in advance for your assistance!

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

Looks like this server is returning "Content-Encoding" in the Vary header which is causing some issues for our caching. I've logged an internal bug to fix this and just ignore invalid values.

View solution in original post

3 Replies
dotMorten_esri
Esri Notable Contributor

Looks like this server is returning "Content-Encoding" in the Vary header which is causing some issues for our caching. I've logged an internal bug to fix this and just ignore invalid values.

MaxPower
New Contributor II

Thank you for your prompt response and for identifying the issue with the "Content-Encoding" in the Vary header. I appreciate that you've logged an internal bug to address this problem.

0 Kudos
dotMorten_esri
Esri Notable Contributor

Fix was just merged and should be in v200.5