Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation
On Mon, Nov 19, 2012 at 2:46 PM, Тимур Галиаскарович Суфиев t.suf...@acti.ru wrote: Timur, ** I got the point: this is exactly the same fragment I've committed on Nov 01, string src/wfs_get_feature.c:825: buffer_copy(id_name, ll-value); Previously (before commits from #19) ll-value contained layer's name, and now it contains ns-uri:layer-name. Should return from ns-uri:layer-name to layer-name somehow... Thanks for the report and your code patch provided throught GitHub (and commited) For the record, this issue is relevant for GeoJSON id (GML one is safe) -- Olivier ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation
Hi Timur, XML validation is such issue-rich subject, so I have another question considering it :). You noticed also this one ^^ Recent TinyOWS commits (from 1st Nov till 13th, I don't know which one exactly is responsible) introduced some changes to feature ids naming, now I have the following error on features update/delete from OpenLayers: #19 introduced that namespaces are also to be checked from Typename parameter. (prior (wrong) behaviour was just to ignore namespace prefix) [Mon Nov 19 16:03:30 2012] [ERROR] Element '{ http://www.opengis.net/ogc}FeatureId', attribute 'fid': ' http://www.tinyows.org/:cities.719' is not a valid value of the atomic type 'xs:ID'. Is 'ns-uri:layer-name.entity-integer-id' a new feature-id by design or something went wrong? Should be only layer.name.entity-integer-id (as ever) Could you confirm that you are using current trunk version or 1.1.0 ? -- Olivier ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation
Yes, it is 1.1.0. The head commit I'm building on is commit 4e6220b43ffd33fb649afc9c954046e7bcbe185d Author: Olivier Courtin olivier.cour...@oslandia.com Date: Wed Nov 14 01:07:34 2012 +0100 update NEWS since previous rc1 Best regards, Timur Sufiev _ From: Olivier Courtin [mailto:olivier.cour...@gmail.com] To: mapserver-users@lists.osgeo.org Sent: Mon, 19 Nov 2012 15:48:20 +0300 Subject: Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation Hi Timur, XML validation is such issue-rich subject, so I have another question considering it :). You noticed also this one ^^ Recent TinyOWS commits (from 1st Nov till 13th, I don't know which one exactly is responsible) introduced some changes to feature ids naming, now I have the following error on features update/delete from OpenLayers: #19 introduced that namespaces are also to be checked from Typename parameter. (prior (wrong) behaviour was just to ignore namespace prefix) [Mon Nov 19 16:03:30 2012] [ERROR] Element '{http://www.opengis.net/ogc}FeatureId', attribute 'fid': 'http://www.tinyows.org/:cities.719' is not a valid value of the atomic type 'xs:ID'. Is 'ns-uri:layer-name.entity-integer-id' a new feature-id by design or something went wrong? Should be only layer.name.entity-integer-id (as ever) Could you confirm that you are using current trunk version or 1.1.0 ? -- Olivier___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation
Olivier, I got the point: this is exactly the same fragment I've committed on Nov 01, string src/wfs_get_feature.c:825: buffer_copy(id_name, ll-value); Previously (before commits from #19) ll-value contained layer's name, and now it contains ns-uri:layer-name. Should return from ns-uri:layer-name to layer-name somehow... Best regards, Timur Sufiev _ From: Olivier Courtin [mailto:olivier.cour...@gmail.com] To: mapserver-users@lists.osgeo.org Sent: Mon, 19 Nov 2012 15:48:20 +0300 Subject: Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation Hi Timur, XML validation is such issue-rich subject, so I have another question considering it :). You noticed also this one ^^ Recent TinyOWS commits (from 1st Nov till 13th, I don't know which one exactly is responsible) introduced some changes to feature ids naming, now I have the following error on features update/delete from OpenLayers: #19 introduced that namespaces are also to be checked from Typename parameter. (prior (wrong) behaviour was just to ignore namespace prefix) [Mon Nov 19 16:03:30 2012] [ERROR] Element '{http://www.opengis.net/ogc}FeatureId', attribute 'fid': 'http://www.tinyows.org/:cities.719' is not a valid value of the atomic type 'xs:ID'. Is 'ns-uri:layer-name.entity-integer-id' a new feature-id by design or something went wrong? Should be only layer.name.entity-integer-id (as ever) Could you confirm that you are using current trunk version or 1.1.0 ? -- Olivier___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation
I found the problem (just in case it may be useful for someone): wfs layers in Javascript were using featureNS: http://www.tinyows.org; while all layers in tinyows.xml used ns_uri=http://www.tinyows.org/; Every symbol matters in deciding whether xml namespaces are the same, so adding trailing slash to Javascript solved my issue. Best regards, Timur Sufiev _ From: Olivier Courtin [mailto:olivier.cour...@gmail.com] To: mapserver-users@lists.osgeo.org Sent: Wed, 07 Nov 2012 21:24:24 +0300 Subject: Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation On Wed, Nov 7, 2012 at 5:13 PM, Тимур Галиаскарович Суфиев t.suf...@acti.ru wrote: Hi Timur, This isn't the first question here about inserting features in TinyOWS, but I haven't found solution to my problem in archives. and this xsd should make tinyows use element '{http://www.tinyows.org}cities' like '{http://www.opengis.net/gml}_Feature' Where am I wrong and what should be changed in my setup? Thanks for your detailled report, first naive question, what about the tinyows.xml config file, and online_resource property ? Next question, what happen, if you bypass schema validation, with: check_schema = 0 (in tinyows element) -- Olivier ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation
On Fri, Nov 16, 2012 at 12:32 PM, Тимур Галиаскарович Суфиев t.suf...@acti.ru wrote: ** I found the problem (just in case it may be useful for someone): wfs layers in Javascript were using featureNS: http://www.tinyows.org; while all layers in tinyows.xml used ns_uri=http://www.tinyows.org/; Every symbol matters in deciding whether xml namespaces are the same, so adding trailing slash to Javascript solved my issue. Thanks Timur to post, for the record, your own answer ! And yes as it's an URI (and not a URL) every symbol matters... Cheers, -- Olivier ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] [TinyOWS] Inserting feature and XML schema validation
Hi! This isn't the first question here about inserting features in TinyOWS, but I haven't found solution to my problem in archives. The working environment is OpenLayers 2.13dev + TinyOWS from github + PostGIS 2.0 + PostgreSQL 9.2 Relevant js-code is: var POINT = 1; var save_objs_strategy = new OpenLayers.Strategy.Save( { saves_what: cities }); var cities = new OpenLayers.Layer.Vector( 'Города', { strategies: [new OpenLayers.Strategy.BBOX(), save_objs_strategy], protocol: new OpenLayers.Protocol.WFS( { version: 1.1.0, url: http://localhost/mapserver/tinyows;, featureType: cities, featureNS: http://www.tinyows.org;, geometryName: geom, outputFormat: JSON, schema: http://localhost/mapserver/tinyows?service=wfsamp;request=DescribeFeatureTypeamp;version=1.1.0amp;typename=tows:cities; }) } ); var draw = new OpenLayers.Control.DrawFeature( cities, OpenLayers.Handler.Point, { title: Создание объектов, displayClass: olControlDrawFeaturePoint } ); draw.events.on( { featureadded: function(e) { var attrs = e.feature.attributes; attrs.pop_hk = 99; attrs.city_name = Новый город; attrs.type_id = POINT; save_objs_strategy.save(); } }); Adding a vector point feature (city) somewhere on the map creates the following XML request to tinyows: wfs:Transaction xmlns:wfs=http://www.opengis.net/wfs; service=WFS version=1.1.0 xsi:schemaLocation=http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd http://www.tinyows.org http://localhost/mapserver/tinyows?service=wfsamp;request=DescribeFeatureTypeamp;version=1.1.0amp;typename=tows:cities; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; wfs:Insert feature:cities xmlns:feature=http://www.tinyows.org; feature:geom gml:Point xmlns:gml=http://www.opengis.net/gml; srsName=EPSG:4326 gml:pos37.962548828124 55.22265625/gml:pos /gml:Point /feature:geom feature:pop_hk99/feature:pop_hk feature:city_nameНовый город/feature:city_name feature:type_id1/feature:type_id /feature:cities /wfs:Insert /wfs:Transaction The request fails with the following string in tinyows.log: [Wed Nov 7 19:55:01 2012] [ERROR] Element '{http://www.tinyows.org}cities': This element is not expected. Expected is one of ( {http://www.opengis.net/gml}_Feature, {http://www.opengis.net/gml}FeatureCollection, {http://www.opengis.net/gml}MultiPointCoverage, {http://www.opengis.net/gml}MultiCurveCoverage, {http://www.opengis.net/gml}MultiSurfaceCoverage, {http://www.opengis.net/gml}MultiSolidCoverage, {http://www.opengis.net/gml}GridCoverage, {http://www.opengis.net/gml}RectifiedGridCoverage, {http://www.opengis.net/gml}Observation, {http://www.opengis.net/gml}DirectedObservation ). This seems a little bit cryptic to me because the schema parameter in js-code (http://localhost/mapserver/tinyows?service=wfsamp;request=DescribeFeatureTypeamp;version=1.1.0amp;typename=tows:cities) returns the following xsd: xs:schema targetNamespace=http://www.tinyows.org/; elementFormDefault=qualified version=1.1xs:import namespace=http://www.opengis.net/gml; schemaLocation=http://schemas.opengis.net/gml/3.1.1/base/gml.xsd/xs:element name=cities type=tows:citiesType substitutionGroup=gml:_Feature/xs:complexType name=citiesTypexs:complexContentxs:extension base=gml:AbstractFeatureTypexs:sequencexs:element name=pop_hk type=int nillable=true minOccurs=0 maxOccurs=1/xs:element name=city_name nillable=false minOccurs=1 maxOccurs=1xs:simpleTypexs:restriction base=stringxs:maxLength value=100//xs:restriction/xs:simpleType/xs:elementxs:element name=geom type=gml:PointPropertyType nillable=true minOccurs=0 maxOccurs=1/xs:element name=type_id type=int nillable=true minOccurs=0 maxOccurs=1//xs:sequence/xs:extension/xs:complexContent/xs:complexType/xs:schema and this xsd should make tinyows use element '{http://www.tinyows.org}cities' like '{http://www.opengis.net/gml}_Feature' Where am I wrong and what should be changed in my setup? Best regards, Timur Sufiev___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] [TinyOWS] Inserting feature and XML schema validation
On Wed, Nov 7, 2012 at 5:13 PM, Тимур Галиаскарович Суфиев t.suf...@acti.ru wrote: Hi Timur, This isn't the first question here about inserting features in TinyOWS, but I haven't found solution to my problem in archives. and this xsd should make tinyows use element '{http://www.tinyows.org}cities' like '{http://www.opengis.net/gml}_Feature' Where am I wrong and what should be changed in my setup? Thanks for your detailled report, first naive question, what about the tinyows.xml config file, and online_resource property ? Next question, what happen, if you bypass schema validation, with: check_schema = 0 (in tinyows element) -- Olivier ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users