0

Using a geoserver WMS getcapabilities request

http://localhost:8080/geoserver/ows?service=wms&version=1.1.1&request=GetCapabilities&format=text/xml ,

the xml is displayed in the browser, but if we take &format=text/xml the request gives a popup to open/download the xml file.

I am trying to display a geoserver WMTS getcapabilities request,

http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetCapabilities ,

in the browser adding the &format=text/xml, but even with the output format ,

http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetCapabilities&format=text/xml,

the request still shows a popup to open/download the xml file.

How do I do a wmts getcapabilities showing the xml file in the browser instead of opening a popup?

closed as off-topic by user30184, whyzar, aldo_tapia, xunilk, Dan C Feb 7 '18 at 14:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions relating to general IT or with no clear GIS component, are off-topic here but can be researched/asked at Stack Overflow (software development), Super User (computing hardware and software), Database Administrators (relational databases) and other SE sites" – user30184, whyzar, aldo_tapia, xunilk
If this question can be reworded to fit the rules in the help center, please edit the question.

4

The return type of a GetCapabilities document from a WMS/WMTS service should always be an application specific one of application/vnd.ogc.wms_xml due to there not being a well defined standard mime type when the specification was written. You can confirm this by using curl to inspect the headers.

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Frame-Options: SAMEORIGIN
content-disposition: inline;filename=wmts-getcapabilities.xml
Content-Type: application/vnd.ogc.wms_xml;charset=UTF-8
Content-Length: 99487
Date: Wed, 07 Feb 2018 13:45:10 GMT

Your problem is that your browser doesn't know what to do with that mime type. So you will need to go into the settings and define that you want the browser to handle that mime type.

  • thank you for your reply. Firefox gives me only two options to set XML application "Always ask" and "Save File". Some other applications has "Preview in Firefox", except XML. Now, if XML is set to "Always ask", why the request (localhost:8080/geoserver/…) is displayed in the browser? How can I set my curl command to inspect the headers? I tried this curl 'localhost:8080/geoserver/topp/gwc/service/…' -o /tmp/wmts-capabilities.xml, but I did not get the right response. Cheers – HelpOverFlow Feb 7 '18 at 18:05

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