Bug report #10489

QGIS Server getcapabilites response is not WMS compliant

Added by aperi2007 - over 5 years ago. Updated almost 5 years ago.

Status:Closed
Priority:High
Assignee:Marco Hugentobler
Category:QGIS Server
Affected QGIS version:2.2.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18901

Description

Hi,

the response of the QGIS Server trunk version don't seem to be WMS Compliant.

I tested it using XML Spy Enterprise and it response the GetLegendGraphics is put in wrong place.

I try using this request:

http://www502.regione.toscana.it/geoscopio_qg/cgi-bin/qgis_mapserv?map=continuum_geologico_rt.qgs&SERVICE=WMS&request=GetCapabilities&version=1.3.0

Also I attach the image from my xmlspy with hard sentence.

Perhaps there some setting to set QGIS to response a valid xml for OGC clients ?

Thx.

qgis_mapserv.xml Magnifier - the xml response from qgis-server (29.3 KB) aperi2007 -, 2014-06-06 12:56 PM

error_validation.gif - the response from XML Spy (57 KB) aperi2007 -, 2014-06-06 12:56 PM

error_validation110.gif - error validation 1.1.0 (54.5 KB) aperi2007 -, 2014-06-06 02:26 PM

error_validation111.gif - error validation 1.1.1 (48.8 KB) aperi2007 -, 2014-06-06 02:30 PM

qgis_mapserv_getcapa_response.zip - a xml response from qgis-server - still invalid (2.99 KB) aperi2007 -, 2014-06-06 11:58 PM

img2.gif - A sample from mapserver response to show ehere should stay the getlegendgraphics tag. (32.2 KB) aperi2007 -, 2014-06-07 12:07 AM

img2.gif - the correct position for getlegendgraphic is this. (57 KB) aperi2007 -, 2014-06-07 12:11 AM

img3.gif - the wrong position used by qgis-server. (53.3 KB) aperi2007 -, 2014-06-07 12:14 AM

img4.gif - Image with ncompatiblity per getstyle and getprint. (43.6 KB) aperi2007 -, 2014-06-07 06:02 AM

Associated revisions

Revision b3a708fb
Added by Jürgen Fischer over 5 years ago

add xsd schema to validate mapserver capabilities (might fix #10489)

History

#1 Updated by aperi2007 - over 5 years ago

I test with a version=1.1.0 request.

error validation 1.1.0

Also it seem invalid.

I put an image with the error message from xml-spy.

#2 Updated by aperi2007 - over 5 years ago

lastly
I tested also the version=1.1.1

error validation 1.1.1

Again it is invalid, seem that the GetPrint command in unknow to xsd 1.1.1

#3 Updated by aperi2007 - over 5 years ago

I send a wrong xml (the firefox transform it in an html file).

SO I resend the right.

#4 Updated by aperi2007 - over 5 years ago

Hi,
I do more tests.
The problem is the GetLegendGraphic that is put in wrong position.

I compare with a VALID getcapabilities response from MapServer.

I attach an image to show where MapServer will put the GetLegendGraphics tag.

#5 Updated by aperi2007 - over 5 years ago

NO !.
Drammatically error.
the correct position for getlegendgraphic is this.
I put a wrong image that show the wrong getcapabilites of qgis-server.
:))

Now I put the right image with the right position.

sorry for noise.

#6 Updated by aperi2007 - over 5 years ago

the wrong position used by qgis-server.

will show the wrong position used by qgis-server.

i hope to not wrong again to send the image. :)

Regards.

#7 Updated by aperi2007 - over 5 years ago

Hi, more informations.

The question is not the positizion, but there is more oproblems.

Firstly the GetCapabilities should be prefixed using a specific prefixname as example "sld"

so the tag become

<sld:GetLegendGraphic>
    <Format>image/jpeg</Format>
    <Format>image/png</Format>
    <DCPType>
     <HTTP>
      <Get>
       <OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www502.regione.toscana.it/geoscopio_qg/cgi-bin/qgis_mapserv?map=continuum_geologico_rt.qgs"/>
      </Get>
     </HTTP>
    </DCPType>
   </sld:GetLegendGraphic>

And add the used prefix in the namespace list:

<WMS_Capabilities 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3.0" 
     xmlns:sld="http://www.opengis.net/sld" 
     xmlns="http://www.opengis.net/wms" 
     xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd">

This resolve the GetCapabilites problem, but after this there are more problems:

Infact
in the GetCapabilites there are also the two tags GetStyles and GetPrint that are not known by xsd of OGC standard.

I study better.

For the GetStyle:
The result was that the GetStyle was introduced in the WMS 1.10, but was definitively dismissed in wms 1.3.0.

This link show the explanation from OGC: http://www.ogcnetwork.net/node/1333

Unfortunately the QGIS-server declare the response WMS 1.3.0.

The GetPrint instead seem to be an invention of QGIS.

So the only choice is remove it.

I dont know why the need to insert in a getcapabilites a non standard tags.

Why this ?

It is pretty unuseful.
The GetCapabilities is useful only to say to a standard client what the Server WMS know of the standard.
Why put in GetCapabilites response a non standard tag that no one client WMS compliant could understand ?

More better to invent an extra request like for example: GetQGISCapabilities,
it is not a standard WMS request so no-one server wms response , instead qgis respond.
Init put all you need.
And leave standard and clean from incompatibility tags the standard GetCapabilities.

I attach an image that show this problem.

Andrea.

#8 Updated by aperi2007 - over 5 years ago

Hi.

I confirm that the action described resolve the validity problem.

I modify the code of qgis-server adding the prefix and the namespace and schemaLocation missed.
Also I comment the code for GetStyle and GetPrint in the GetCapability response.

And voila' the response now is VALID.

For me is ok .

Now we have our "qgis-server" compliant with ogc and inspire.

:))

Regards.

#9 Updated by Jürgen Fischer over 5 years ago

Is there any practical problem with this?

#10 Updated by aperi2007 - over 5 years ago

I dont know who really use the
tags

GetStyles and GetPrint in the GetCapabilities.

Surely no one of the standard OGC client like Arcgis, QGIS, Autoca, Geotool-based and so on no one could use this two tags.

I don't know if the two web client for qgis like the
"QGIS Web client" and the "Lizmap web client" will use it.

AFAIK the GetCapabilities is a standard OGC world used response. And some proprietary tags in it will break the compatibility.

As example our client based on the GeoTools and based on a rigorous apply of OGC stadard will fail.
Also any other standard client like ArcGIS that use the getcapabilities to understand what layers and what functionalyity will fail if the response is not standard.

If agree with this consideration.
I could open a PULL for a Patch.
The patch fixe the namespace of getLegendGraphics and remove the tags GetStyle and GetPrint from the GetCapabilities Response.

I tested the patch on my qgis-server (the same of the ticket). Now it is patched and is OGC compliant in the wms 1.3.0 getcapabilities response.

Regards.

#11 Updated by Jürgen Fischer over 5 years ago

  • Status changed from Open to Closed

#12 Updated by Jürgen Fischer over 5 years ago

aperi2007 - wrote:

Surely no one of the standard OGC client like Arcgis, QGIS, AutoCAD, Geotool-based and so on no one could use this two tags.

Of course, but they also don't have a problem with it.

I don't know if the two web client for qgis like the "QGIS Web client" and the "Lizmap web client" will use it.

Not sure about Lizmap, but QWC does. GetPrint was introduced for QWC.

AFAIK the GetCapabilities is a standard OGC world used response. And some proprietary tags in it will break the compatibility.

Not really. I don't know any client that checks the validity of the GetCapabilities response.

As example our client based on the GeoTools and based on a rigorous apply of OGC standard will fail.
Also any other standard client like ArcGIS that use the getcapabilities to understand what layers and what functionalyity will fail if the response is not standard.

Did you verify that that's actually true? ArcGIS 10.1 apparently doesn't have a problem with QGIS server. And invalid responses might do no harm at all as long as all the expected stuff is actually there - which is the case. Clients shouldn't be to picky as there are lots of servers out that have "alternative" interpretations of the spec.

If agree with this consideration. I could open a PULL for a Patch. The patch fixe the namespace of getLegendGraphics and remove the tags GetStyle and GetPrint from the GetCapabilities Response.

I suppose that would break existing clients (that are not that picky on validity). Does QGIS Desktop still work (ie. does it show the legend)? I suppose b3a708fba doesn't and still should make the response valid. Although letting the schemaLocation point at an extended schema might be in a grey area of the spec. Maybe there is a cleaner way to extend the schema without introducing a different namespace. I didn't find any, but I'm not an XML expert. xmlpatternsvalidator at least doesn't complain anymore.

I tested the patch on my qgis-server (the same of the ticket). Now it is patched and is OGC compliant in the wms 1.3.0 getcapabilities response.

Which clients did you use to test?

#13 Updated by aperi2007 - over 5 years ago

  • Status changed from Closed to Reopened

Hi,
I see your solution.

Unfortunately if is a license violation of License.

Please read this
http://schemas.opengis.net/wms/ReadMe.txt

and after this
http://www.opengeospatial.org/ogc/legal/
More important this paragraph:

The materials contained in the Site may be downloaded or copied provided that ALL copies retain the copyright and any other proprietary notices >contained on the materials. No material may be modified, edited or taken out of context such that its use creates a false or misleading statement or >impression as to the positions, statements or actions of OGC.

AFAIK you cannot download the XSD of OGC and change it inserting in it the new tags.

You should rewrite it from scratch.
Not so easy.

A.

#14 Updated by aperi2007 - over 5 years ago

I rsponde between rows:

aperi2007 - wrote:

Surely no one of the standard OGC client like Arcgis, QGIS, AutoCAD, Geotool-based and so on no one could use this two tags.

Of course, but they also don't have a problem with it.

I know how work arcgis.
I use arcgis 9.3.1
It call for capabilities and show all the layers it find.
You know it ?

I don't know if the two web client for qgis like the "QGIS Web client" and the "Lizmap web client" will use it.

Not sure about Lizmap, but QWC does. GetPrint was introduced for QWC.

> AFAIK the GetCapabilities is a standard OGC world used response. And some proprietary tags in it will break the compatibility.

Not really. I don't know any client that checks the validity of the GetCapabilities response.

The GetCapabilities is a standard OGC. So it MUST BE used with a standard OGC xsd.
You cannot change it otherwise it is not compiant.
ANY PUBLIC ADMINISTRATION IN EUROPE IS CALLED TO USE INPSIRE.
The use of a server that is not inspire compliant (ogc compliant) is a violation of european laws.
And cannot be fund with public money.

As example our client based on the GeoTools and based on a rigorous apply of OGC standard will fail. Also any other standard client like ArcGIS that >use the getcapabilities to understand what layers and what functionalyity will fail if the response is not standard.

Did you verify that that's actually true? ArcGIS 10.1 apparently doesn't have a problem with QGIS server. And invalid responses might do no harm at all >as long as all the expected stuff is actually there - which is the case. Clients shouldn't be to picky as there are lots of servers out that have >"alternative" interpretations of the spec.

In Italy a public administration cannot say to an user "hey buy a arcgis 10 license " because your arcgi 9.3 don't work with my incompatible OGC server.
I Guess also in other european menber states is the same.

If agree with this consideration. I could open a PULL for a Patch. The patch fixe the namespace of getLegendGraphics and remove the tags GetStyle and >GetPrint from the GetCapabilities Response.

I suppose that would break existing clients (that are not that picky on validity). Does QGIS Desktop still work (ie. does it show the legend)? I suppose
b3a708fba doesn't and still should make the response valid. Although letting the schemaLocation point at an extended schema might be in a grey area of
the spec. Maybe there is a cleaner way to extend the schema without introducing a different namespace. I didn't find any, but I'm not an XML expert.
xmlpatternsvalidator at least doesn't complain anymore.

ok, I don' t well explain.
Tne qgis desktop is totally neutral on this problem.

The GetStyles and GetPrint tags ARE NOT present in Mapserver and Geoserver.

IS qgus workng with Mapserver or GeoServer ?

Surely yes.
SO the GetStyles and GetPrint are unusegul for QGIS desktop.

They are added to give a commercial advantege to some web portal solution.
That adopting a non standard OGC solution hope to gain a piece of market.

But a public administration cannot be the funder of a product not interoperable and not compliant with inspire specificitaio

SO I Guess actually the clients of this product are or private subject or PA that don't understand well this question.

But is ESRI and Autocad and so on
will understand this will have no problem to explain well to their new potential client that QGIS server is NOT compliant with Inspire and so is unuseful.

Regards,

Andrea.

#15 Updated by Jürgen Fischer over 5 years ago

  • Status changed from Reopened to In Progress

aperi2007 - wrote:

AFAIK you cannot download the XSD of OGC and change it inserting in it the new tags.

I didn't. The schema references the original schema as include and uses the intended element for the extension - just like your approach. Only without requiring a separate namespace and a prefix for the operation. Not sure if there is a (more canonical?) way to do that.

#16 Updated by aperi2007 - over 5 years ago

sorry.
I dont understand.
AFAIK the better solution is add the namespace.

This is the code to set the change in the qgiswmsserver.cpp.

wmsCapabilitiesElement.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
--> wmsCapabilitiesElement.setAttribute( "xmlns:sld", "http://www.opengis.net/sld" );
--> wmsCapabilitiesElement.setAttribute( "xsi:schemaLocation", "http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd" );

and also this:

//wms:GetLegendGraphic
--> elem = doc.createElement( "sld:GetLegendGraphic"/*wms:GetLegendGraphic*/ );

This code correct the GetLegendGraphics problem.

Obviously still remain to resolve the presence of GetStyle e GetPrint.

#17 Updated by zicke - over 5 years ago

QGIS server has a GetProjectSettings request which has a lot more information for QGIS webclient (which the GetPrint tag is for). In earlier times there was no such request and the GetCapabilities request was "abused". Now, probably you can get rid of these vendor things in the GetCababilities response.

Stefan

#18 Updated by Jürgen Fischer over 5 years ago

aperi2007 - wrote:

Not really. I don't know any client that checks the validity of the GetCapabilities response.

The GetCapabilities is a standard OGC. So it MUST BE used with a standard OGC xsd.

I know. But I don't know any client that actually validated the response.

In Italy a public administration cannot say to an user "hey buy a arcgis 10 license " because your arcgi 9.3 don't work with my incompatible OGC server.
I Guess also in other european menber states is the same.

I was just asking if you actually tried any clients and found any that actually fail. Any client that only accepts fully valid GetCapabilities responses will probably have problems with lots of available WMS servers and also be very slow as validating the schema takes much time. So I suppose in practice no client will actually do that and hence any client capable to work with any valid schema will be able to ignore elements that it doesn't support and in turn should also work with QGIS' response. That doesn't mean that QGIS' shouldn't be compliant - it just questions the actual relevance of it.

To me it was unclear if you just suspect that ArcGIS doesn't work or if you actually verified that it has. That I found ArcGIS 10.1 working (and now verified that 9.2 also appears to work) suggested that it was just a hunch.

#19 Updated by Jürgen Fischer over 5 years ago

aperi2007 - wrote:

sorry. I dont understand.

http://qgis.org/wms_1_3_0.xsd reads:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wms="http://www.opengis.net/wms" targetNamespace="http://www.opengis.net/wms">
  <include schemaLocation="http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd"/>
  <element name="GetLegendGraphic" type="wms:OperationType" substitutionGroup="wms:_ExtendedOperation" />
  <element name="GetPrint" type="wms:OperationType" substitutionGroup="wms:_ExtendedOperation" />
  <element name="GetStyles" type="wms:OperationType" substitutionGroup="wms:_ExtendedOperation" />
</schema>

So the schema wasn't copied.

AFAIK the better solution is add the namespace.

Right, but it might break existing clients and it's unclear to me if there are any clients that would benefit from it.

This is the code to set the change in the qgiswmsserver.cpp.

wmsCapabilitiesElement.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
--> wmsCapabilitiesElement.setAttribute( "xmlns:sld", "http://www.opengis.net/sld" );
--> wmsCapabilitiesElement.setAttribute( "xsi:schemaLocation", "http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd" );

If we did that I'd propose a qgis namespace similiar to the above xsd listing all the available extensions (ie. like umn mapserver does).

#20 Updated by aperi2007 - over 5 years ago

QGIS server has a GetProjectSettings request which has a lot more information for QGIS webclient (which the GetPrint tag is for). In
earlier times there was no such request and the GetCapabilities request was "abused". Now, probably you can get rid of these vendor things
in the GetCababilities response.

Stefan

Hi Stefan,
yes your solution is the right think to do.

Put all not ogc compliant things in a not standard request/response couple.
So it can host every new introduced by qgis. And leave the standard response only for standard things.

Thx,

Andrea.

#21 Updated by aperi2007 - over 5 years ago

Right, but it might break existing clients and it's unclear to me if there are any clients that would benefit from it.

This is the code to set the change in the qgiswmsserver.cpp.

wmsCapabilitiesElement.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" ); --> >wmsCapabilitiesElement.setAttribute( "xmlns:sld", "http://www.opengis.net/sld" ); --> wmsCapabilitiesElement.setAttribute( >"xsi:schemaLocation", "http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld >http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd" );

If we did that I'd propose a qgis namespace similiar to the above xsd listing all the available extensions (ie. like umn mapserver does).

The client actually don't do any type of validation otherwise they will fails.
This mena thay don't use any standard library to parse and extract informations from the xml response otherwise they fail in invalidity.
This mean the client parse the response manually.

This mean also that QGIS is caged by some manual client that use a non standard and not wms compliant xml response ?

This is the better think that may hope a commercial product like esri.
:))

#22 Updated by Jürgen Fischer over 5 years ago

aperi2007 - wrote:

If we did that I'd propose a qgis namespace similiar to the above xsd listing all the available extensions (ie. like umn mapserver does).

The client actually don't do any type of validation otherwise they will fails.
This mena thay don't use any standard library to parse and extract informations from the xml response otherwise they fail in invalidity.
This mean the client parse the response manually.

Not validating doesn't mean that you don't use a standard library and do manual parsing. You can use a standard library and still skip the validation - actually you probably always will for performance reason unless there is reasonable doubt that the response is correct (eg. for debugging while developing or if you use an unreliable transport path etc).

This mean also that QGIS is caged by some manual client that use a non standard and not wms compliant xml response?

Extending the GetCapabilities response is covered by the spec - that's what the _ExtendedOperation element is for. I think we're in a grey area now. AFAICT the spec doesn't clearly state where the schemeLocation should point, there is intended room for extension and validation tools are probably unable to spot any invalidity now, but we're probably still outside the intended interpretation of the spec as GetCapabilities "shall contain an XML Schema instance schemaLocation attribute that binds the “http://www.opengis.net/wms” namespace to the schema in E.1." - which it does - but indirectly ;)

But the solution with the qgis namespace would be fine and valid - although it still might break clients.

#23 Updated by aperi2007 - over 5 years ago

Extending the GetCapabilities response is covered by the spec - that's what the _ExtendedOperation element is for. I think we're in a
grey area now. AFAICT the spec doesn't clearly state where the schemeLocation should point, there is intended room for extension and
validation tools are probably unable to spot any invalidity now, but we're probably still outside the intended interpretation of the
spec as GetCapabilities "shall contain an XML Schema instance schemaLocation attribute that binds the “http://www.opengis.net/wms”
namespace to the schema in E.1." - which it does - but indirectly ;)

The important is to grant the compatibility with the OGC spec. So the solution with the extendedoperation is valid if it is compliant with the OGC xsd.

But the solution with the qgis namespace would be fine and valid - although it still might break clients.

I tested the "qgis" prefix solution instead of "sld" with XMLSPy.
It is valid.

And francly, to update the own client from "sld" or "none" to "qgis" is really easy.
And to have a qgis-server compliant is more advantage for all.

So the correct should be:

<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3.0" xmlns="http://www.opengis.net/wms" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd" xmlns:qgis="http://www.opengis.net/sld">

...
   <qgis:GetLegendGraphic>
    <Format>image/jpeg</Format>
    <Format>image/png</Format>
    <DCPType>
     <HTTP>
      <Get>
       <OnlineResource xlink:type="simple" xmlns:xlink="...omissis..."/>
      </Get>
     </HTTP>
    </DCPType>
   </qgis:GetLegendGraphic>

this is the "qgis" namspace definition:

--> xmlns:qgis="http://www.opengis.net/sld"

and the schemaLocation:
should point also to the
http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd

Regards,

A.

#24 Updated by Jürgen Fischer over 5 years ago

aperi2007 - wrote:

I tested the "qgis" prefix solution instead of "sld" with XMLSPy.
It is valid.

Isn't the current solution "valid" for xmlspy too?

#25 Updated by Jürgen Fischer over 5 years ago

aperi2007 - wrote:

I tested the "qgis" prefix solution instead of "sld" with XMLSPy.
It is valid.

And does it also make ArcGIS 9.2 work for you?

#26 Updated by aperi2007 - over 5 years ago

aperi2007 - wrote:

I tested the "qgis" prefix solution instead of "sld" with XMLSPy. It is valid.

Isn't the current solution "valid" for xmlspy too?

I tested it using the official and valid xsd from OGC.

The question is not only xmlspy.
I don't tested your solution, but I understand you point to another xsd that you have put on your site.

This xsd is not the official xsd.
I try to explain better:
Is it exactly equals to that from OGC ?

If yes why point it on your private site ?.
If you stop your site, the server response will become unvalidable.

if it is not equals to the official xsd , this mean you have chage something in the standard.

And surely the xmlspy will validable it.
But xmlspy don't know that the address you use is not the official url requested from the specs.
:)

So you have a valid xml but absolutely no grant to be interoperable because you valid on a different xsd rather than the official.

A.

#27 Updated by Jürgen Fischer over 5 years ago

aperi2007 - wrote:

The question is not only xmlspy.

I think I fully understand your concerns. My question just is if there are any clients affected by this. I also don't know if there are actually clients (still) relying on the current behaviour. Maybe other can comment on that.

For instance does ArcGIS 9.3 actually validate the schema, while 9.2 and 10.1 apparently don't? I suspect that 9.3 will still have problems even when the validity issue is fixed.

I don't tested your solution, but I understand you point to another xsd that you have put on your site.

But the spec doesn't require that you use the xsd directly from OGC. It explicitly allows to use a copy:

7.2.4 GetCapabilities response

7.2.4.1 Introduction

When invoked on a WMS, the response to a GetCapabilities request shall be an XML document containing service metadata formatted according to the XML Schema in E.1. The schema specifies the mandatory and optional content of the service metadata and how the content is formatted. The XML document shall contain a root element named WMS_Capabilities in the “http://www.opengis.net/wms” namespace. This element shall contain an XML Schema instance schemaLocation attribute that binds the “http://www.opengis.net/wms” namespace to the schema in E.1. The schema bound to the root attribute may be a copy of the schema in E.1 instead of the master copy at the URL stated in the annex provided none of the normative content of the schema is changed. The schema copy shall be located at a fully-qualified and accessible URL to permit XML validating software to retrieve it. The response shall be valid according to XML Schema validation rules.

It's explictly stated if extensions actually mean that "the normative content of the schema is changed" - as the spec explictly allows extensions and the scheme is the OGC xsd + those extensions. The extensions usually are in an separate xsd (which with my limited xml knowledge always come with a separate namespace), but "6.9.5 Extended capabilities and operations" also doesn't explictly requires that either.

#28 Updated by aperi2007 - over 5 years ago

But the spec doesn't require that you use the xsd directly from OGC. It explicitly allows to use a copy:

Yes but is a technical need by the parser.
The parser "de facto" when parser using thexsd must download it.

Of course this mean that you could download it and put it on your site.

Must the spec explicitly DENY that you MODIFY IT and (perhaps) deny also the redistribute.
I don't know if the OGC licence deny the redistribution.

But surely the ISO organization (just as another example of the distributor of the WMS SPecs)
explixitly deny the redistribution of their XSD.

You can download but for your internal use only.

The two organization seem apparently tohave different logics but instead both have the same goal (objective) in mind

To have a GRANT that the user that download the xsd DON'T CHANGE something in it.

One say "you cannot change anythin" the other say "you cannot redistribute".
So avoid the confiusion.

Onestly if one has the xsd in its site, when has any problem is more easy to change a little row in it rather then
the change its code.
:))

So to point forward the original in the original site is like say
"I am compliant to the original specs as you can see".

Instaed point to a different site , a private site is like see
"My product work with my xsd. I hopeis equals to the original, but I dont know".

So I guess more better to point directly it.

Otherwise the QGIS himself has any risk that someone
could add new fetures and add them also to the xsd on it site.
No-one could detect this, the validation tets will pass , but was not autentically valid.

And when was discovered that the validity is FALSE the qgis credibility was definitively compromise.

Please notice:
I discovered the invalidity because I have a problem with our software and after a day spent to search the problem on out software I do a test on validity of xml response of qgis.

The response was surprisly for me.

If you was using a xsd on your site that match fully the need of qgis.
The validity in the xmlspy was be passed, but also my software was still go in error because it wrong to parse the response because It dont know that there is a GetPrint tag in that position.
And lost many more time to discovered it.

I guess this is a bad practice.I practice that I avoid because is dangerous and expose to future changing and waste of time to understand why that software don't work with qgis-server.

A

#29 Updated by Jürgen Fischer over 5 years ago

aperi2007 - wrote:

But the spec doesn't require that you use the xsd directly from OGC. It explicitly allows to use a copy:

Yes but is a technical need by the parser.
The parser "de facto" when parser using the xsd must download it.

Of course this mean that you could download it and put it on your site.

Must the spec explicitly DENY that you MODIFY IT and (perhaps) deny also the redistribute.
I don't know if the OGC licence deny the redistribution.

Of course, that's what a spec is for. If you claim we are non-compliant back that up with a statement from the spec that we violate. We don't need to assess why a spec sets clear bounds in some areas and leaves room for interpretation in others - we just need to stay within the bounds it sets to be compliant. According to the spec extensions are ok and pointing at different schema locations is ok unless "the normative content of the schema is changed". I don't know if the there is an other part of the spec that elaborates what that quote actually supposed to mean and if aren't compliant to that, but I don't see something in that quoted paragraph that we clearly violate.

I'm not saying that we are compliant, but I also don't say that we non-compliant. I don't know if we actually violate the spec. Sorry, but your general remarks about generic standards don't help with that.

I'd also like do have direct answers to my questions about which clients you found being affected (you claimed ArcGIS 9.3 has problems, while I didn't find problems with 9.2 and 10.1) and whether they are still affected and if those problems arise just from the capabilities being invalid or if those clients actually can't cope with extensions, although they should when the schema includes any according to the spec. In the latter case we could - for the sake of interoperability with non-compliant clients - maybe have an optional setting to avoid exposing the extensions. But as said earlier to be affected by this, a client must validate the response (which most probably don't for performance reasons) and/or iterate the requests listing in capabilities and look for stuff that it doesn't support, although that might make an otherwise perfectly usable service unusable.

What I want to know: which clients are affected by the current behaviour and which clients would be affected by a changes of the current behaviour (extended requests without a prefix). You seem to avoid answering direct questions to that, I don't know and those who do might not be available until after the pentecost weekend. So we probably just have to wait.

#30 Updated by Even Rouault over 5 years ago

I agree with Jürgen that it is not completely clear what "The schema bound to the root attribute may be a copy of the schema in E.1
instead of the master copy at the URL stated in the annex provided none of the normative content of the schema is changed" really permits or bans. I think the intent was that it was allowed to change comments and documentation (as stated in the intro paragraph of E.1), but perhaps not extending the schema itself.

The way Inspire proceeds to extend WMS 1.3.0 can be a source of inspiration (pun intended ;-)) in that case.

For example, here's the beginning of the response of UMN MapServer to a GetCapabilities request to a project configured with Inspire extensions:

<WMS_Capabilities version="1.3.0" 
     xmlns="http://www.opengis.net/wms" 
     xmlns:sld="http://www.opengis.net/sld" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:ms="http://mapserver.gis.umn.edu/mapserver" 
     xmlns:inspire_common="http://inspire.ec.europa.eu/schemas/common/1.0" 
     xmlns:inspire_vs="http://inspire.ec.europa.eu/schemas/inspire_vs/1.0" 
     xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd
                         http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd
                         http://inspire.ec.europa.eu/schemas/inspire_vs/1.0 http://inspire.ec.europa.eu/schemas/inspire_vs/1.0/inspire_vs.xsd
                         http://mapserver.gis.umn.edu/mapserver http://www.geodaten-mv.de/dienste/inspirevs_test?language=ger&amp;service=WMS&amp;version=1.3.0&amp;request=GetSchemaExtension">

and later in the doc :

  <inspire_vs:ExtendedCapabilities>
    <inspire_common:MetadataUrl xsi:type="inspire_common:resourceLocatorType">
      <inspire_common:URL>http://www.geodaten-mv.de/soapServices/CSWStartup?service=CSW&amp;version=2.0.2&amp;request=GetRecordById&amp;outputSchema=http://www.isotc211.org/2005
/gmd&amp;ElementSetName=full&amp;Id=4d5f1402-5b2b-43ec-949f-92d125179318</inspire_common:URL>
      <inspire_common:MediaType>application/vnd.ogc.csw.capabilities.response_xml</inspire_common:MediaType>
    </inspire_common:MetadataUrl>
    <inspire_common:SupportedLanguages>
      <inspire_common:DefaultLanguage><inspire_common:Language>ger</inspire_common:Language></inspire_common:DefaultLanguage>
      <inspire_common:SupportedLanguage><inspire_common:Language>eng</inspire_common:Language></inspire_common:SupportedLanguage>
    </inspire_common:SupportedLanguages>
    <inspire_common:ResponseLanguage><inspire_common:Language>ger</inspire_common:Language></inspire_common:ResponseLanguage>
  </inspire_vs:ExtendedCapabilities>

The http://inspire.ec.europa.eu/schemas/inspire_vs/1.0/inspire_vs.xsd schema is :

<schema xmlns:inspire_vs="http://inspire.ec.europa.eu/schemas/inspire_vs/1.0" xmlns:inspire_common="http://inspire.ec.europa.eu/schemas/common/1.0" xmlns:wms="http://www.opengis.net/wms" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="http://inspire.ec.europa.eu/schemas/inspire_vs/1.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0.1">
    <import namespace="http://www.opengis.net/wms" schemaLocation="http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd"/>
    <import namespace="http://inspire.ec.europa.eu/schemas/common/1.0" schemaLocation="../../common/1.0/common.xsd"/>
    <element name="ExtendedCapabilities" type="inspire_common:ExtendedCapabilitiesType" substitutionGroup="wms:_ExtendedCapabilities"/>
</schema>

#31 Updated by Giovanni Manghi over 5 years ago

  • Category set to QGIS Server

#32 Updated by Jürgen Fischer over 5 years ago

  • Priority changed from Severe/Regression to High

#33 Updated by Paolo Cavallini over 5 years ago

  • Subject changed from QGIS Server getcapabilites response is not WMS compliant ! to QGIS Server getcapabilites response is not WMS compliant

#34 Updated by René-Luc ReLuc almost 5 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Assignee set to Marco Hugentobler
  • Target version set to Version 2.8

#35 Updated by Marco Hugentobler almost 5 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF