[TinyOWS-users] Problem inserting features

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Wed Sep 21 01:04:31 EST 2011


Hi,

I believe this is implemented as the WFS 1.1.0 standard suggests:

8.3.1 Supporting multiple namespaces
An XML Schema[6] document can only describe elements that belong to a single namespace. This means that a Web Feature Service cannot describe features from multiple namespaces in a single XML Schema document. To overcome this limitation, a WFS may generate an XML Schema document that is a "wrapper" schema that imports the schemas of the features from the various namespaces in the request. For example, consider the following request:
<?xml version="1.0" ?>
<DescribeFeatureType
version="1.1.0"
service="WFS"
xmlns="http://www.opengis.net/wfs"
xmlns:ns01="http://www.server01.com/ns01"
xmlns:ns02="http://www.server02.com/ns02"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd">
<TypeName>ns01:TreesA_1M</TypeName>
<TypeName>ns02:RoadL_1M</TypeName>
</DescribeFeatureType>
A WFS may generate the following response to this request:

<?xml version="1.0" ?>
<schema
targetNamespace="http://www.someserver.com/myns"
xmlns:myns=http://www.someserver.com/myns
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<import namespace="http://www.server01.com/ns01"
schemaLocation="http://www.myserver.com/wfs.cgi?
request=DescribeFeatureType&amp;typeName=ns01:TreesA_1M"/>
<import namespace="http://www.server02.com/ns02"
schemaLocation="http://www.yourserver.com/wfs.cgi?
OpenGIS(c) Specification OGC 04-094
Copyright (c) Open Geospatial Consortium, Inc (2005) 27
request=DescribeFeatureType&amp;typeName=ns02:RoadL_1M"/>
</schema>
In this example, the WFS is using a DescribeFeatureType request to obtain the schemas of the features in the various namespaces. This is simply an example; other methods of obtaining the schemas may be implemented (for example: referencing static schema documents).

Geoserver also behaves similarly with many different namespaces 
http://demo.opengeo.org/geoserver/wfs?service=wfs&version=1.1.0&request=describefeaturetype


-Jukka Rahkonen-

Brian May
 
> Oliver,
> 
> Figured out what the issue was with the terse output, and maybe you 
> could add some error checking to tinyows --check to check for this 
> mistake I made:
> 
> If the ns_prefix attribute does not match between layers 
> defined in the 
> config file, the following is returned by 
> http://192.168.2.105/cgi-bin/tinyows?service=WFS&request=Descr
ibeFeatureType&version=1.1.0& 
> <http://192.168.2.105/cgi-bin/tinyows?service=WFS&request=Desc
ribeFeatureType&version=1.1.0&>
> 
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns="http://www.w3.org/2001/XMLSchema" 
> elementFormDefault="qualified">
> <xs:import namespace="http://192.168.2.105/" 
> schemaLocation="192.168.2.105/cgi-bin/tinyows?service=WFS&vers
> ion=1.1.0&request=DescribeFeatureType&typename=saunders_lines_
albers"/>
> <xs:import namespace="http://192.168.2.105/" 
> schemaLocation="192.168.2.105/cgi-bin/tinyows?service=WFS&vers
> ion=1.1.0&request=DescribeFeatureType&typename=france"/>
> </xs:schema>
> 
> If the ns_prefix attributes match, you get:
> 
> <xs:schema xmlns:feature="http://192.168.2.105/" 
> xmlns:ogc="http://www.opengis.net/ogc" 
> xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns="http://www.w3.org/2001/XMLSchema" 
> xmlns:gml="http://www.opengis.net/gml" 
> targetNamespace="http://192.168.2.105/" 
> elementFormDefault="qualified" 
> version="1.1">
> <xs:import namespace="http://www.opengis.net/gml" 
> schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
> <xs:element name="saunders_lines_albers" 
> type="feature:saunders_lines_albersType" 
> substitutionGroup="gml:_Feature"/>
> <xs:complexType name="saunders_lines_albersType">
> <xs:complexContent>
> <xs:extension base="gml:AbstractFeatureType">
> <xs:sequence>
> <xs:element name="id" type="int" nillable="true" minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="mytext" type="string" nillable="true" minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="the_geom" type="gml:CurvePropertyType" 
> nillable="true" 
> minOccurs="0" maxOccurs="1"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> <xs:element name="france" type="feature:franceType" 
> substitutionGroup="gml:_Feature"/>
> <xs:complexType name="franceType">
> <xs:complexContent>
> <xs:extension base="gml:AbstractFeatureType">
> <xs:sequence>
> <xs:element name="id_geofla" type="decimal" nillable="true" 
> minOccurs="0" maxOccurs="1"/>
> <xs:element name="code_chf_l" type="string" nillable="true" 
> minOccurs="0" maxOccurs="1"/>
> <xs:element name="nom_chf_l" type="string" nillable="true" 
> minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="x_chf_lieu" type="int" nillable="true" 
> minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="y_chf_lieu" type="int" nillable="true" 
> minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="x_centroid" type="int" nillable="true" 
> minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="y_centroid" type="int" nillable="true" 
> minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="nom_dept" type="string" nillable="true" 
> minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="code_reg" type="string" nillable="true" 
> minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="nom_region" type="string" nillable="true" 
> minOccurs="0" maxOccurs="1"/>
> <xs:element name="code_dept" type="string" nillable="true" 
> minOccurs="0" 
> maxOccurs="1"/>
> <xs:element name="the_geom" type="gml:MultiSurfacePropertyType" 
> nillable="true" minOccurs="0" maxOccurs="1"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> </xs:schema>
> 
> Brian
> 
> On 9/19/2011 5:53 PM, Olivier Courtin wrote:
> >
> >> Also, not sure why, but after some change I made, the url
> >> 
> http://myurl/cgi-bin/tinyows?service=WFS&request=DescribeFeatu
reType&version=1.1.0&
> >> is producing a much more terse output than before. Haven't 
> figured out what
> >> it is yet, although if I take out my custom layer, and 
> just have the france
> >> demo, the verbose output comes back.
> >>
> >> If its easier to help debug this, I can open it up to the 
> outside world
> >> temporarily.
> > If you give me enough information to reproduce it,
> > i can go on, but right not yet the case.
> >
> 
> 
> _______________________________________________
> TinyOWS-users mailing list
> TinyOWS-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tinyows-users
> 


More information about the TinyOWS-users mailing list