Ticket #22 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Cannot enable/disable the request XML validation

Reported by: nsavard Owned by: nsavard@…
Priority: major Version: SVN
Keywords: xml validate validate client request Cc: adube@…
Triage Stage: Unreviewed State of Approval: Unnecessary
Attached Patches: None Complexity: Unknown
Compatibility: Unknown Specification: Unnecessary

Description

The query request is validated against the corresponding schema within ows_request_check() function. The problem is that some client software doesn't validate, like Open Layers?, and it's no more possible to use Tinyows. Sometime we need to make Tinyows to answer to the incoming request even though its structure is not correctly built (e.g. testing).

I propose to add a new 'server' tag in the config.xml file and a 'xmlvalidate' parameter within this delimited tags section to allow a user to enable/disable the client request validation. A new Ows structure member 'xml_validate' of boolean type will be added. A test will be added in ows_request_check() function to verify its value before calling ows_schema_validation() function.

Comments are welcome.

Attachments

transaction-examples.xml (4.5 kB) - added by adube 3 years ago.
3 transaction tests (insert, delete, update)

Change History

Changed 3 years ago by ol

Hi Normand,

Humm my first (naive) comment is: Wasn'it more a WFS client problem ? Maybe it will be more simple/appropriate to fix that directly on OL code...

On the other hand we could also see there a way to improve performance with a safetyless policy... Do you have example with OL WFS request ?

Changed 3 years ago by adube

Here's a simple wfs:GetFeature POST request OL creates. TinyOWS would refuse this without Normand's hack.

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd http://127.0.0.1:8080/ http://127.0.0.1:8080/cgi-bin/tinyows?service=WFS&amp;version=1.0.0&amp;request=DescribeFeatureType&amp;TypeName=bdga_route_l_arc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <wfs:Query typeName="feature:bdga_route_l_arc" xmlns:feature="http://127.0.0.1:8080/">
    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:BBOX>
        <ogc:PropertyName>the_geom</ogc:PropertyName>
        <gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:32198">
          <gml:coordinates decimal="." cs="," ts=" ">-407531.21555472584,173424.560318053 -382836.78444527416,191063.439681947</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

Changed 3 years ago by ol

Alexandre,

I've just check with TinyOWS SVN and the previous query, and it's work just fine...

export QUERY_STRING=`cat OL_REQUEST`

./tinyows

Content-Type: application/xml


<?xml version='1.0' encoding='UTF-8'?>
<wfs:FeatureCollection
...

What is the libxml2 version used ? Cf Ticket #13

Changed 3 years ago by nsavard

Re #comment:3

Olivier: We're going to check which library version we have and let you know.

Changed 3 years ago by adube

libxml2 version 2.7.2

Changed 3 years ago by nsavard

Re comment:1

Olivier,

I do agree with you and more than you think since I'm working on the OGC compliance testing for Map Server?. However we need to provide a workaround for an application developer to go on on his project and meets its deadline, even though a client software does not send a valid XML request. Alexandre opened OL ticket 1779 (http://trac.openlayers.org/ticket/1779) a while ago and it has still not been fixed.

Changed 3 years ago by adube

Sorry I gave you a wrong clue there. I just remembered that I had no problems with the getFeature request, only transactions.

In 3 transactions tests (insert, delete and update), only the "insert" didn't work. I got a "xml isn't valid" error message. The other 2 worked fine. See the transaction-examples.xml file attached.

Changed 3 years ago by adube

3 transaction tests (insert, delete, update)

Changed 3 years ago by ol

  • status changed from new to closed
  • resolution set to fixed

A specific XSD schema is now generated on the fly on transaction request, it should fix this problem as r121

Changed 3 years ago by ol

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 2 years ago by ol

  • status changed from reopened to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.