ThinkGeo.com    |     Documentation    |     Premium Support

Problem with specific WMS service

Hi guys,

I am using WinForms 10.0. Trying to connect to a WMS service using the following:

https://nowcoast.noaa.gov/arcgis/services/nowcoast/wwa_meteocean_tropicalcyclones_trackintensityfcsts_time/MapServer/WmsServer?

When Open() is used I always get the following error:

The remote server returned an error: (403) Forbidden.

However, if I paste a GetCapabilties request into a browser it works fine. As follows:

https://nowcoast.noaa.gov/arcgis/services/nowcoast/wwa_meteocean_tropicalcyclones_trackintensityfcsts_time/MapServer/WmsServer?service=WMS&version=1.3.0&request=GetCapabilities

I have attached a sample project, there’s not much to it.

Thanks!

Steve

WMSProblems.zip (904.6 KB)

Hi Steven1,

Thanks for the detailed information. I reproduced you issue and found out that UserAgent was required for this wms server.

I fixed this by adding a UserAgent property to WmsRasterLayer. Feel free to upgrade your package ThinkGeo.MapSuite.Layers.Wms to 11.0.0-beta024 or above(the new build will be available after one or two days). Then you can set UserAgent like the following code:

wmsRasterLayer.UserAgent = "ThinkGeoMap or other string you prefer"

If you don’t want to wait the new build, you can also set UserAgent in SendingWebRequest event,

CType(e.WebRequest, HttpWebRequest).UserAgent = "ThinkGeoMap or other string you prefer"

Thanks,
Leo

Leo,

Thanks, the 11.0.0-beta024 package works fine. Will this be in a production build soon?

Thanks!

Steve

Hey @Steven1,

Normally, we’ll batch up changes to put into v10, but if you need these change soon, we can cherry pick this fix in to production within a few days.

Thanks,
Kyle

1 Like