Hey guys,
Thanks for the swift responses.
I took your advice and tried to reproduce the results. In the process of
doing that, I came to realize that this was in fact user error.
Basically a colleague of mine had been working on a WFS client and had been
constructing the original XML requests and then submitting them to my
GeoServer instance remotely, so it was difficult to communicate the requests
that he was sending to me. Turns out that the problem was due to having 2
"ogc" namespace prefix declarations with different URIs: 1 in the GetFeature
element and 1 in the filter itself. We're guessing the extra one crept in
there because he developed the KVP requests first, and then used those as
the starting point for our XML requests. Since the mistake was
innocuous-looking enough, neither one of us managed to catch it when we were
debugging our requests the other day. Apparently, the extra namespace
declaration causes a whole host of weird unrelated bugs with behavior
similar to those I had elaborated in my original message.
Oddly enough, our hack fix of removing the ogc: prefixes only works by
complete accident. When I tried to repro it today, I had a couple extra
namespace declarations in the request, like so:
(Note: the actual names and numbers have been changed to protect the
innocent)
<?xml version="1.0"?>
<wfs:GetFeature
service="WFS"
version="1.1.0"
xmlns="http://www.opengis.net/wfs"
xmlns:cite="http://www.opengeospatial.net/cite"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<wfs:Query typeName="cite:feature">
<ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="
http://www.opengis.net/gml">
<PropertyIsLessThan>
<PropertyName>int_prop</PropertyName>
<Literal>100</Literal>
</PropertyIsLessThan>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
However, this request is met with a cast exception similar to the one we
observed for our original PropertyIsBetween requests. If you remove the
first two namespace declarations, though, and use a request like this
instead:
<?xml version="1.0"?>
<wfs:GetFeature
service="WFS"
version="1.1.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<wfs:Query typeName="cite:feature">
<ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="
http://www.opengis.net/gml">
<PropertyIsLessThan>
<PropertyName>int_prop</PropertyName>
<Literal>100</Literal>
</PropertyIsLessThan>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
it somehow manages to go through without a hitch and completes normally even
though it's wrong. Not sure why that unique combination allows that to
happen, but that's what we've observed.
As a slight aside, I've found a pretty neat tool that makes troubleshooting
XML WFS requests a heck of a lot easier. It's a Firefox plugin called Poster
that lets you input your own XML fragments or XML files, and allows you to
specify your MIME types and everything. Beats the pants off of having 1 guy
make code changes on the client side, send in the request, then talking back
and forth with him over IM when it fails for the umpteenth time. Using it
seemed to drastically cut down on your turnaround time during testing and
made identifying the bug a lot easier.
Hope this info helps, and again, thanks for the replies.
Phony
On Wed, Nov 3, 2010 at 10:55 AM, Andrea Aime
<[email protected]>wrote:
> On Wed, Nov 3, 2010 at 3:17 PM, Justin Deoliveira <[email protected]>
> wrote:
> > Hi,
> > Can you include the full XML document you are sending for the request.
> Also
> > can you replicate the problem against any layer, say one of the layers
> that
> > ships with GeoServer?
>
> Wondering... might it be due to http://jira.codehaus.org/browse/GEOS-2028?
>
> Cheers
> Andrea
>
> -----------------------------------------------------
> Ing. Andrea Aime
> Senior Software Engineer
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
>
> phone: +39 0584962313
> fax: +39 0584962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -----------------------------------------------------
>
------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware,
phishing sites, and compromised hosts - saving your company time,
money, and embarrassment. Learn More!
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users