I have installed QGIS server on Ubuntu 14.04 which serves WMS. Connection uses https and basic auth. URL is https://my.awesome.url:8090/cgi-bin/project1/qgis_mapserv.fcgi I can connect with QGIS and view my data. So far so good.
I installed OSGeo4W64 on Windows and are trying to build my own application using QGIS. I managed to build a window, load a simple shape, even load another WMS service but when trying to load my own WMS I get nothing except an error.
uri_separator = '&' uri_url = 'url=https://my.awesome.url:8090/cgi-bin/project1/qgis_mapserv.fcgi' uri_username = 'username=user' uri_password = 'password=pass' uri_format = 'format=image/png' uri_layers = 'layers=mylayer' uri_crs = 'crs=EPSG:25831' url_with_params = uri_separator.join((uri_url, uri_username, uri_password, uri_format, uri_layers, uri_crs)) rlayer = QgsRasterLayer(url_with_params, 'norther', 'wms') print rlayer.error().message()
<p><b>Raster layer:</b> Provider is not valid (provider: wms, URI: url=https://my.awesome.url:8090/cgi-bin/project1/qgis_mapserv.fcgi&username=user&password=pass&format=image/png&layers=mylayer&crs=EPSG:25831
The logs on the server don't give anything useful
I tried adding the following but that doesn't help.
uri_service = 'SERVICE=WMS' uri_version = 'VERSION=1.3.0' uri_request = 'REQUEST=GetMap'
I also tried remove format, layers and crs but then the error is:
<p><b>WMS provider:</b> Cannot calculate extent<p><b>Raster layer:</b> Provider is not valid (provider: wms, URI:
I'm already busy for hours and tried so many options, I'm really out of ideas...