Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS SERVER - error in parsing WMS GetFeatureInfo as XML #28369

Closed
qgib opened this issue Nov 19, 2018 · 14 comments
Closed

QGIS SERVER - error in parsing WMS GetFeatureInfo as XML #28369

qgib opened this issue Nov 19, 2018 · 14 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server

Comments

@qgib
Copy link
Contributor

qgib commented Nov 19, 2018

Author Name: Umberto Minora (@umbe1987)
Original Redmine Issue: 20549
Affected QGIS version: 3.4.1
Redmine category:qgis_server
Assignee: Alessandro Pasotti


Don't know if it's a real bug, but it's something I'd like to be fixed for my own application.
I use to parse the GetFeatureInfo request as XML with the ".responseXML" method.
I am receiving this error:
@errore interpretazione XML: tag corrispettivo mancante. Previsto: .@
It seems the missing closing tag is causing this.
A testing URL for the request looks like this:
https://www.wondermap.it/cgi-bin/qgis_mapserv.fcgi?&map=/home/ubuntu/qgis/projects/Demo_sci_WMS/demo_sci.qgs&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=domini%20sciabili&LAYERS=domini%20sciabili&INFO_FORMAT=text%2Fhtml&I=50&J=50&CRS=EPSG%3A3857&STYLES=&WIDTH=101&HEIGHT=101&BBOX=1128900.381669475%2C5866529.499870181%2C1129865.3991515755%2C5867494.517352281

@qgib
Copy link
Contributor Author

qgib commented Nov 19, 2018

Author Name: Giovanni Manghi (@gioman)


No error here with the provided URL.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Nov 19, 2018

Author Name: Umberto Minora (@umbe1987)


There's no error in the GetFeatureInfo request.
But if you look in the source (view-source:https://www.wondermap.it/cgi-bin/qgis_mapserv.fcgi?&map=/home/ubuntu/qgis/projects/Demo_sci_WMS/demo_sci.qgs&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=domini%20sciabili&LAYERS=domini%20sciabili&INFO_FORMAT=text%2Fhtml&I=50&J=50&CRS=EPSG%3A3857&STYLES=&WIDTH=101&HEIGHT=101&BBOX=1128900.381669475%2C5866529.499870181%2C1129865.3991515755%2C5867494.517352281) you'll notice that the tag is not closed.
This is fine from HTML point of view, but not in XML.
if you make (as I do) an XML HttpRequest and try to change the response to XML (see https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML), it will fail.

@qgib
Copy link
Contributor Author

qgib commented Nov 19, 2018

Author Name: Umberto Minora (@umbe1987)


The reason why I am using responseXML is to catch WMS Exception (see https://stackoverflow.com/a/51723660/1979665).

@qgib
Copy link
Contributor Author

qgib commented Nov 19, 2018

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Nov 19, 2018

Author Name: Uroš Preložnik (@uprel)


Umberto Minora wrote:

This is fine from HTML point of view, but not in XML.
if you make (as I do) an XML HttpRequest and try to change the response to XML (see https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML), it will fail.

If you need response in XML, why not just ask it with INFO_FORMAT=text/xml instead of text/html.

@qgib
Copy link
Contributor Author

qgib commented Nov 20, 2018

Author Name: Umberto Minora (@umbe1987)


Uroš Preložnik wrote:

If you need response in XML, why not just ask it with INFO_FORMAT=text/xml instead of text/html.
Because not all WMS accepts INFO_FORMAT=text/xml.
For example, Mapserver has default text/plain (https://mapserver.org/uk/ogc/wms_server.html#web-object-metadata).
I know it's not a big deal, but it's just to be cleaner in the response and allowing clients to be able to convert the server response to XML without getting this error. Again, I don't think it can be defined as bug though, it might be more a feature request.

@qgib
Copy link
Contributor Author

qgib commented Nov 20, 2018

Author Name: Alessandro Pasotti (@elpaso)


PR #8520


  • status_id was changed from Open to In Progress
  • assigned_to_id was configured as Alessandro Pasotti

@qgib
Copy link
Contributor Author

qgib commented Nov 21, 2018

Author Name: Anónimo (Anónimo)


Applied in changeset 0d696ef.


  • status_id was changed from In Progress to Closed
  • done_ratio was changed from 0 to 100

@qgib
Copy link
Contributor Author

qgib commented Nov 21, 2018

Author Name: Umberto Minora (@umbe1987)


Thank you Alessandro, will test it soon!

@qgib
Copy link
Contributor Author

qgib commented Nov 21, 2018

Author Name: Umberto Minora (@umbe1987)


Anyway, if I have installed qgis-server using the deb package, should I wait for the next release before I can test it?

@qgib
Copy link
Contributor Author

qgib commented Nov 21, 2018

Author Name: Alessandro Pasotti (@elpaso)


Yes, unless you test the nightly builds or a docker image built from a recent master

@qgib
Copy link
Contributor Author

qgib commented Nov 27, 2018

Author Name: Umberto Minora (@umbe1987)


Don't know if I miss anything but I updated qgis-server to 3.4.2 expecting to see the closing meta tag resolved, but I seem to still have the same error.
From here I see this fix was included in the last release:final-3_4_2...master. However, looking at the GetFeatureInfo response of my WMS it seems the same as before: (view-source:https://www.wondermap.it/cgi-bin/qgis_mapserv.fcgi?map=/home/ubuntu/qgis/projects/Demo_sci_WMS/demo_sci.qgs&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=domini_sciabili&LAYERS=domini_sciabili&INFO_FORMAT=text%2Fhtml&I=50&J=50&CRS=EPSG%3A3857&STYLES=&WIDTH=101&HEIGHT=101&BBOX=1162989.3853589566%2C5840094.709100607%2C1170709.5252157594%2C5847814.848957409).
I tried to clear the cache, update QGIS DESKTOP and replacing the former qgs project on the server with the one saved with the newer (3.4.2) version, but still the same result.
Am I missing something? Thanks in advance for any feedback.


  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Nov 27, 2018

Author Name: Alessandro Pasotti (@elpaso)


I wasn't backported to 3.4, it will be in 3.6

@qgib
Copy link
Contributor Author

qgib commented Nov 28, 2018

Author Name: Giovanni Manghi (@gioman)


  • resolution was changed from to fixed/implemented
  • status_id was changed from Reopened to Closed

@qgib qgib closed this as completed Nov 28, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server
Projects
None yet
Development

No branches or pull requests

1 participant