3

Whenever I add a WMS layer, from a server on the local intranet, the WMS request gets sent to localhost instead of the actual server I am referencing.

I am enclosing screenshots to make sure my problem is clear.

Here's how I add a new WMS connection: enter image description here

When I hit connect, the layers from the server are actually listed as shown below, showing that atleast the GetCapabilities request is going through fine: enter image description here

However, the map doesn't show up and I get a 'Connection Refused' label under the map layer: enter image description here

When I look in the logs, I see that the error message references 'localhost' instead of the server I set: enter image description here

Clearly, something seems off. If I just copy the request from the log window and replace the localhost with my server IP into Firefox, then the request goes through fine and I see the map in Firefox.

Stranger still, is that if I look at the layer information, the server URL is referenced correctly: enter image description here

This seems to be happening only in Windows QGIS builds. On Linux, the map shows up as expected.

Here is the QGIS version information: enter image description here

I am posting here to check if I am doing something wrong. I can't seem to find a QGIS bug that describes this issue so I want to rule out that I am getting something wrong.

  • 5
    Tick the check boxes "Ignore GetMap/GetTile URI" and "Ignore GetFeatureInfo URI". The WMS server must have wrong URL in GetCapabilities. You can check that from 192.1681.31:19090/…. It is up to the WMS server how it can be configured right. – user30184 Sep 26 '15 at 9:07
  • 1
    @user30184 You are absolutely right. It was indeed an error in my server configuration which sent the wrong URL as part of the GetCapabilities response. Once I fixed that, QGIS renders the map correctly. Can you please convert your comment into an answer so that I can accept it and mark this question as having been answered? – balajeerc Sep 26 '15 at 11:27
  • I think that question is not off-topic. It is rather common that at least UMN MapServers send wrong URIs because they must be written by hand into map files. Some clients use always GetCapabilities URI also for GetMaps which can hide faulty settings. All WMS users should be aware of that. – user30184 Sep 27 '15 at 11:05
  • I'm re-opening this to give @user30184 (or anyone else who may wish to as well) the opportunity to write up an answer. – PolyGeo Sep 27 '15 at 21:34
  • @user30184 Yes, please convert your comment into an answer so that I can accept it. – balajeerc Sep 28 '15 at 6:22
1

The issue here appears to be that the WMS GetCapabilities response has http://localhost... hard coded into it, whereas it should have http://192.168.1.38...

QGIS provides the option to ignore the reported GetMap and GetFeatureInfo service end points, (by ticking the check boxes), and instead use the URL you supplied to obtain the GetCapabilities response.

  • Do you know if this is possible to do in ArcMap also? – Endre Moen Dec 4 '17 at 16:08
  • 1
    @EndreMoen I can't see any obvious way through standard interface to do the same in ArcMap (I'm on 10.3). You might ask a new question on this and see if you get any ESRI experts giving you an alternate approach. One possibility might be to set up a GDAL connector, but that's me thinking with a QGIS hat on. – nmtoken Dec 4 '17 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.