Hexagon Geospatial
MENU

WebGIS

Need a push in the right direction when configuring WebMap, Portal or SDI services? Looking for hints and tips, or just looking for Ideas and information? The WebGIS discussion board is where you start those discussions, connect and share information.
Showing results for 
Search instead for 
Do you mean 
Reply
Super Contributor
Posts: 301
Registered: ‎02-09-2016

WMS showing fine in leaflet, could not show anything in Geospatial Portal

[ Edited ]

HI team,

 

Our client has a portal and they are using a third party wms service. The service is displaying fine in leaflet.

 

2017-10-04 16_42_47-AzureGISDemoVM - 13.70.136.110_3389 - Remote Desktop Connection.png

 

However, when consuming the service in portal, it displays the message "Not available Please refresh your browser and try again". 

 

3.png

 

 

I also check the url requests and they do return images. 

 

I also play aroudn the wms configuration (display mode) in the portal to see whether it helps but no luck so far.

 

5.png 

 

Appreciate all ideas and suggestions to resolve this problem.

 

Kind regards,

 

Staff
Posts: 98
Registered: ‎02-10-2017

Re: WMS showing fine in leaflet, could not show anything in Geospatial Portal

Hi.

 

Does your WMS uses https?

Can you share the WMS url for testing?

Technical Evangelist
Posts: 1,118
Registered: ‎09-11-2015

Re: WMS showing fine in leaflet, could not show anything in Geospatial Portal

Hi Bob,

 

The "Not Available" image is returned by the WMS service. Can you double check the WMS URL that you can see in the developer console - copy and paste it to new browser tab? Is the BBOX correct, x/y axes order?

 

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Super Contributor
Posts: 301
Registered: ‎02-09-2016

Re: WMS showing fine in leaflet, could not show anything in Geospatial Portal

Hi team,

 

The url wms is http and it has structure as follows.

 

tt.png

 

From my testing, I have no issue adding the service into the portal data sources. I also monitor the request get image urls, generated by portal, I paste them to a new browser tab, they all return images; however, according to the source, the "Not avaiable" displaying in Portal Map indicate that something incorrect in the URL either api_key or map service name are incorrect which confuses me.

 

I wonder Portal could do something to trigger the "Not avaiable" image

 

Kind regards,

 

 

 

 

Technical Evangelist
Posts: 1,118
Registered: ‎09-11-2015

Re: WMS showing fine in leaflet, could not show anything in Geospatial Portal

[ Edited ]

Hi Bob,

 

I found the source of the problem but it opens other questions...

 

This behavior is caused because of different request header used by Portal and by web browser:

  • Portal adds Referer: <Portal server URL>
  • Web browser does not add Referer, because you visit the URL manually from the address bar
  • OpenLayers display images differently, not causing the adding of Referer.

When I replay the request sent by Portal in Fiddler, it displays the "Not Available" image. But if I remove the Referer request header, normal image will display. For me it looks like some kind of limitation on the WMS service. I am not sure whether this can be somehow altered from the Portal side Smiley Sad

 

I will investigate further...

 

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Technical Evangelist
Posts: 1,118
Registered: ‎09-11-2015

Re: WMS showing fine in leaflet, could not show anything in Geospatial Portal

After thinking about this for a while I came to a conclusion that this is by design:

 

Portal sends URLs to the services which can be comparable as having links on your webpage and user clicks them. Because of that, the web browser adds HTTP Referer to the request and this will ultimately fail on your WMS service provider as it for some reason does not like requests having this header. I quite don't understand why they would not like to process this requests as it's mainly used for statistical purposes...

 

The way to work around this problem is to customize the global browser setting to disable this

Disabling the HTTP Referer should not have any side effects except having unrelated ads displayed on web pages Smiley Wink

 

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Staff
Posts: 294
Registered: ‎11-05-2015

Re: WMS showing fine in leaflet, could not show anything in Geospatial Portal

Requiring a properly set Referrer header looks like some kind of authorization mechanism employed by the WMS. Why it doesn't throw up when the header is missing undermines this theory, though.

 

Either way, hiding the Referrer header looks like an ugly hack (and not cross-browser to that). I'm wondering on the exact way you constructed your test harness utilizing Leaflet, because Consumer Portal uses it as well and it uses standard browser capabilities to display images which result in the header being added. The only time we saw the Referrer header being skipped is when you run your image loading site (Leaflet based, or Geospatial Portal) from the local file system or from inside a sourceless IFrame. This still doesn't look like a production-worthy workaround.

 

Apart from all that, this looks like a try in abusing the WMS which uses an API key. Is it your API key? Smiley Happy Can you ask the WMS owners to reconfigure it?

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.