[Geoserver-users] WFS GetFeature Post Request

Dear community,

I have a received a message from an engineers office on a faulty wfs filter request to get features from our GeoServer (Version 2.4.4):

The Request was:

POST http://www.list.smwa.sachsen.de/baustelleninfo/wfs? HTTP/1.1

Content-Type: text/xml;charset=UTF-8

User-Agent: Iwan WebMapServer (info:http://www.webmapserver.de/) IDUGeolib/6.2.0 Build 145

Connection: Keep-Alive

Content-Length: 889

Host: www.list.smwa.sachsen.de

Authorization: Basic U1BFUlJfU046IVNwM3IxNE4h

<?xml version='1.0' encoding='UTF-8'?>

<wfs:Query typeName=‘services:Strassensperrungen_Aktuell’>

wfs:PropertyNameservices:geom</wfs:PropertyName>

ogc:PropertyNameservices:geom</ogc:PropertyName><gml:Envelope xmlns:gml=‘http://www.opengis.net/gml’ srsName=‘EPSG:31468’>

gml:lowerCorner5674610.89993951 4623372.64610281</gml:lowerCorner>

gml:upperCorner5675455.82080778 4624530.12384099</gml:upperCorner>

</gml:Envelope>

ogc:PropertyNameservices:Verwaltungskennziffer</ogc:PropertyName>

0014627

</wfs:Query>

</wfs:GetFeature>

and the answer:

<ows:ExceptionReport xmlns:ows=“http://www.opengis.net/ows” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” version=“1.0.0” xsi:schemaLocation=“http://www.opengis.net/ows http://www.list.smwa.sachsen.de:80/baustelleninfo/schemas/ows/1.0.0/owsExceptionReport.xsd”>

<ows:Exception exceptionCode=“InvalidParameterValue”>

ows:ExceptionTextInvalid request

cvc-pattern-valid: Value ‘services:Strassensperrungen_Aktuell’ is not facet-valid with respect to pattern ‘((\w:)?\w(=\w)?){1,}’ for type ‘TypeNameListType’.

cvc-attribute.3: The value ‘services:Strassensperrungen_Aktuell’ of attribute ‘typeName’ on element ‘wfs:Query’ is not valid with respect to its type, ‘TypeNameListType’.</ows:ExceptionText>ows:ExceptionTextcvc-pattern-valid: Value ‘services:Strassensperrungen_Aktuell’ is not facet-valid with respect to pattern ‘((\w:)?\w(=\w)?){1,}’ for type ‘TypeNameListType’.</ows:ExceptionText>ows:ExceptionTextcvc-attribute.3: The value ‘services:Strassensperrungen_Aktuell’ of attribute ‘typeName’ on element ‘wfs:Query’ is not valid with respect to its type, ‘TypeNameListType’.</ows:ExceptionText></ows:Exception></ows:ExceptionReport>

Does anyone know why this Post-request fails?

Thanks in advance!

Stephan

On Wed, Nov 5, 2014 at 10:26 AM, Klemm, Stephan - LIST <
Stephan.Klemm@anonymised.com> wrote:

Does anyone know why this Post-request fails?

Because the underscore, _ , is not an allowed character in WFS 1.1 typenames

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------

Hi,

Where does the requirement not to accept underscore come from? I have been thinking that the WFS 1.1.0 schema presents QName leads to NCName with a possible prefix

<xsd:complexType name="FeatureTypeType">
<xsd:annotation>
<xsd:documentation>
            An element of this type that describes a feature in an application
            namespace shall have an xml xmlns specifier, e.g.
            xmlns:bo="[http://www.BlueOx.org/BlueOx"](http://www.blueox.org/BlueOx%22);
         </xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="Name" type="xsd:QName">

And NCName according to this document does allow underscores everywhere:

http://www.datypic.com/sc/xsd/t-xsd_NCName.html

-Jukka Rahkonen-

···

Andrea Aime wrote:

On Wed, Nov 5, 2014 at 10:26 AM, Klemm, Stephan - LIST <Stephan.Klemm@anonymised.com> wrote:

Does anyone know why this Post-request fails?

Because the underscore, _ , is not an allowed character in WFS 1.1 typenames

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


On Wed, Nov 5, 2014 at 1:30 PM, Rahkonen Jukka (Tike) <
jukka.rahkonen@anonymised.com> wrote:

  Hi,

Where does the requirement not to accept underscore come from? I have
been thinking that the WFS 1.1.0 schema presents QName leads to NCName with
a possible prefix

In the Query typeName is not defined as NCName, but as TypeNameListType:

<xsd:attribute name="typeName" type="wfs:TypeNameListType" use="required">
<xsd:annotation>
<xsd:documentation>
The typeName attribute is a list of one or more feature type names that
indicate which types of feature instances should be included in the reponse
set. Specifying more than one typename indicates that a join operation is
being performed. All the names in the typeName list must be valid types
that belong to this query's feature content as defined by the GML
Application Schema.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
...
<xsd:simpleType name="TypeNameListType">
<xsd:restriction base="wfs:Base_TypeNameListType">
<xsd:pattern value="((\w:)?\w(=\w)?){1,}">
<xsd:annotation>
<xsd:documentation>
Example typeName attribute value might be: typeName="ns1:Inwatera_1m=A,
ns2:CoastL_1M=B" In this example, A is an alias for ns1:Inwatera_1m and B
is an alias for ns2:CoastL_1M.
</xsd:documentation>
</xsd:annotation>
</xsd:pattern>
</xsd:restriction>
</xsd:simpleType>

The funny thing is that the documentation uses _, but then again the XML
validators do not accept it,
and the moment I removed it, the validation of the document passed.
So, I have to assume that \w does not include "_" as a valid char.
According to some docs I've found on the internet \w is defined as:

"Any character that might appear in a word. A shortcut for
'[#X0000-#x10FFFF]-[\p{P}\p{Z}\p{C}]' (all characters except the set of
"punctuation", "separator", and "other" characters)."

I guess _ might be seen as a separator?

I've also tried to use "ns1:Inwatera_1m=A, ns2:CoastL_1M=B" in a
GetFeature, and I cannot find a way to fix it,
which is not surprising, since WFS 1.1 does not support joining to start
with...

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------

Hi both,

thanks for your help!

Well, then the engineering office must take up the version 1.0.0! J Nope, we’ll just adjust the layer name and wait…

Best Regards

Stephan

Von: andrea.aime@…84… [mailto:andrea.aime@…84…] Im Auftrag von Andrea Aime
Gesendet: Mittwoch, 5. November 2014 14:12
An: Rahkonen Jukka (Tike)
Cc: Klemm, Stephan - LIST; GeoServer Mailing List List
Betreff: Re: [Geoserver-users] WFS GetFeature Post Request

On Wed, Nov 5, 2014 at 1:30 PM, Rahkonen Jukka (Tike) <jukka.rahkonen@…486…> wrote:

Hi,

Where does the requirement not to accept underscore come from? I have been thinking that the WFS 1.1.0 schema presents QName leads to NCName with a possible prefix

In the Query typeName is not defined as NCName, but as TypeNameListType:

<xsd:attribute name=“typeName” type=“wfs:TypeNameListType” use=“required”>

xsd:annotation

xsd:documentation

The typeName attribute is a list of one or more feature type names that indicate which types of feature instances should be included in the reponse set. Specifying more than one typename indicates that a join operation is being performed. All the names in the typeName list must be valid types that belong to this query’s feature content as defined by the GML Application Schema.

</xsd:documentation>

</xsd:annotation>

</xsd:attribute>

<xsd:simpleType name=“TypeNameListType”>

<xsd:restriction base=“wfs:Base_TypeNameListType”>

<xsd:pattern value=“((\w:)?\w(=\w)?){1,}”>

xsd:annotation

xsd:documentation

Example typeName attribute value might be: typeName=“ns1:Inwatera_1m=A, ns2:CoastL_1M=B” In this example, A is an alias for ns1:Inwatera_1m and B is an alias for ns2:CoastL_1M.

</xsd:documentation>

</xsd:annotation>

</xsd:pattern>

</xsd:restriction>

</xsd:simpleType>

The funny thing is that the documentation uses _, but then again the XML validators do not accept it,

and the moment I removed it, the validation of the document passed.

So, I have to assume that \w does not include “_” as a valid char.

According to some docs I’ve found on the internet \w is defined as:

“Any character that might appear in a word. A shortcut for ‘[#X0000-#x10FFFF]-[\p{P}\p{Z}\p{C}]’ (all characters except the set of “punctuation”, “separator”, and “other” characters).”

I guess _ might be seen as a separator?

I’ve also tried to use “ns1:Inwatera_1m=A, ns2:CoastL_1M=B” in a GetFeature, and I cannot find a way to fix it,

which is not surprising, since WFS 1.1 does not support joining to start with…

Cheers

Andrea

==

GeoServer Professional Services from the experts! Visit

http://goo.gl/NWWaa2 for more information.

==

Ing. Andrea Aime

@geowolf

Technical Lead

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://www.geo-solutions.it

http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Sorry, coming to this thread a little late after experiencing the same
error...

geowolf wrote

So, I have to assume that \w does not include "_" as a valid char.

I know it's only a little book, but Regular Expression Pocket Reference by
Tony Stubblebine <http://shop.oreilly.com/product/9780596004156.do&gt; tells
me that (Class shorthands \w, ...), a word character is often all ASCII
alphanumeric characters plus the underscore, however... can include
additional locale or Unicode alphanumerics. So this definition tells us
that the underscore should be matched by the regex and should work with
strict CITE conformance to WFS 1.1.0.

I'm not sure whether this makes an error like the below a bug in GeoServer
(2.7.0), or a bug with one or more XML validators, but it does seem to be a
bug.

James

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/WFS-GetFeature-Post-Request-tp5171303p5206460.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

From this old thread https://sourceforge.net/p/deegree/mailman/deegree-users/?viewmonth=201009&viewday=17 you can read that Markus Schneider from the deegree project and unnamed people from the OGC WFS group considered "that the schema is broken, but it's o.k. to use underscores."

Also http://stackoverflow.com/questions/3367205/is-something-wrong-with-my-regex explains:

a) from XML Schema reference on regexp:
\w - Any character that might appear in a word. A shortcut for '[#X0000-#x10FFFF]-[\p{P}\p{Z}\p{C}]' (all characters except the set of "punctuation", "separator", and "other" characters).

b) underscore character definition in Unicode is 'LOW LINE' (U+005F), category: punctuation, connector [Pc]

Thus underscore seems to be a punctuation mark and punctuation marks are not allowed in \w and therefore underscore breaks the WFS schema.

-Jukka Rahkonen-

________________________________________
nmtoken wrote:

Sorry, coming to this thread a little late after experiencing the same
error...

geowolf wrote

So, I have to assume that \w does not include "_" as a valid char.

I know it's only a little book, but Regular Expression Pocket Reference by
Tony Stubblebine <http://shop.oreilly.com/product/9780596004156.do&gt; tells
me that (Class shorthands \w, ...), a word character is often all ASCII
alphanumeric characters plus the underscore, however... can include
additional locale or Unicode alphanumerics. So this definition tells us
that the underscore should be matched by the regex and should work with
strict CITE conformance to WFS 1.1.0.

I'm not sure whether this makes an error like the below a bug in GeoServer
(2.7.0), or a bug with one or more XML validators, but it does seem to be a
bug.

James

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/WFS-GetFeature-Post-Request-tp5171303p5206460.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

We are preparing to move to a new server, and at the same time upgrade Geoserver from 2.3.1 to (at least) 2.5.4. The new server is a Centos 7 server and we have got Tomcat 8 and Geoserver working already. But before setting GEOSERVER_DATA_DIR to point to old 2.3.1 data, I'd like to know, what should I do (configuration?).

Oiva Hakala, Natural Resources Institute Finland

On Tue, May 26, 2015 at 11:49 AM, Hakala Oiva (Luke) <oiva.hakala@anonymised.com.>
wrote:

We are preparing to move to a new server, and at the same time upgrade
Geoserver from 2.3.1 to (at least) 2.5.4. The new server is a Centos 7
server and we have got Tomcat 8 and Geoserver working already. But before
setting GEOSERVER_DATA_DIR to point to old 2.3.1 data, I'd like to know,
what should I do (configuration?).

Just make a backup of the entire content of the data directory, as a newer
GeoServer might modify its contents, besides that, nothing else to do.
If you are doing the upgrade now I'd suggest to move to a 2.6.x though, the
2.5.x series is no longer supported, 2.6.x is in maintenance mode
(only bug fixes) for another 4 months instead, while 2.7.x (current stable)
has 10 months ahead.

Cheers
Andrea

--

Meet us at the INSPIRE Conference in Lisbon 25-29 May 2015! Visit
http://goo.gl/WHKDXT for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------