Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1453 closed bug (fixed)

WMS Layer URL is damaged when loaded via Python

Reported by: hdus Owned by: mhugent
Priority: critical: causes crash or data corruption Milestone:
Component: WMS Version: Trunk
Keywords: WMS Python Cc:
Must Fix for Release: Yes Platform: Linux
Platform Version: Awaiting user input: no

Description

I load a WMS-Layer with

self.iface.addRasterLayer(url, displayName,service,layerList,styleList,imageType,srs);

All parameters are defined correct. The Layer is loaded to the legend. The tooltip of the layerconnection shows the correct URL.

http://srsofaioi12288:8080/geoserver/wms?

After check the visibility checkbox QGIS responses with the following error message:

Could not draw Grundbuchplan because:
WMS Server responded unexpectedly with HTTP Status Code 404 (Not Found)
Tried URL: http://srsofaioi12288:80/geoserver/wms?SERVICE=WMS&SERVICE=WMS&VERSION=1.1.1&.......

Here you can see two strange things:

  1. Port 8080 is changed to port 80
  2. SERVICE=WMS appears twice

Loading this WMS via WMS-Connector works without problems.

Change History (4)

comment:1 by jef, 15 years ago

The first url is used for the GetCapabilities request. The GetCapabilities response contains an url that is used to the GetMap requests that actually load the images to display.

I suspect that the OnlineResource returned by GetCapabilities points to the second url you see. That would be a problem of the WMS server.

That would be consistent with the fact that if the layer is initially off, checking the visibility box triggers the first GetMap request.

in reply to:  1 comment:2 by hdus, 15 years ago

Replying to jef:

The first url is used for the GetCapabilities request. The GetCapabilities response contains an url that is used to the GetMap requests that actually load the images to display.

I checked the Capabilities output and I see a well defined onlineressource with port 8080:

<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://srsofaioi12288:8080/geoserver/wms?SERVICE=WMS&amp;"/>

In addition the OnlineRessource shows SERVICE=WMS after ? thats the reason for the twice SERVICE=WMS, but one 80 is missing. I've to correct my former post. With the WMS connector QGIS shows the same faulty behaviour.

I suspect that the OnlineResource returned by GetCapabilities points to the second url you see. That would be a problem of the WMS server.

That would be consistent with the fact that if the layer is initially off, checking the visibility box triggers the first GetMap request.

comment:3 by jef, 15 years ago

Resolution: fixed
Status: newclosed

fixed in r9841

comment:4 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.