Select to view content in your preferred language

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

348
5
Jump to solution
06-27-2024 02:19 AM
Labels (3)
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

5 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

PreetiMaske
Esri Regular Contributor

Good news!  ArcGIS Maps SDK version 200.5.0 was just released today and issue is fixed with this release.

Thank you for bringing this one to our attention!

0 Kudos
MaxPower
New Contributor II

Thank you for the update! I’ve updated to ArcGIS Maps SDK version 200.5.0 and tested the WMS layer again. Unfortunately, I’m still encountering the same error:

 

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

 

Could you confirm if this fix was specifically tested with the WMS layer I’m using (URL: https://geo4.service24.rlp.de/wms/rp_dop40.fcgi, Layer name: rp_dop40)? If there’s any additional troubleshooting or configurations I should try, please let me know.

Thanks again for your continued support!

0 Kudos