0

I am trying to use WFS 2.0 specifically because it supports temporal filtering. My GetCapabilities.xml file is

<GetCapabilities
version="2.0"
service="WFS"
xmlns="http://www.opengis.net/wfs"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/2.0/wfs.xsd"/>

I use curl to make the request i.e.

curl -X POST -H "Content-type: application/gml+xml;version=3.2" -d @GetCapabilities.xml http://ws-beta.int.unavco.org:9090/geoserver/wfs 

But I receive the error:

<ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://ws-beta.int.unavco.org:9090/geoserver/schemas/ows/1.1.0/owsAll.xsd">
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>java.lang.IllegalArgumentException: java.lang.ClassCastException@44895b09
java.lang.ClassCastException@44895b09</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

I know the problem is almost certainly in my construction of the XML file because it works over HTTP:

http://my.geoserver.url/geoserver/wfs?service=wfs&version=2.0.0&request=GetCapabilities

I seek a working version of GetCapabilities.xml for WFS 2.0.

I have also tried using GET rather than POST, i.e.

curl -X GET -H "Content-type: application/gml+xml;version=3.2" -d @GetCapabilities.xml http://ws-beta.int.unavco.org:9090/geoserver/wfs 

I get a different error in this case:

<ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://ws-beta.int.unavco.org:9090/geoserver/schemas/ows/1.1.0/owsAll.xsd">
  <ows:Exception exceptionCode="MissingParameterValue" locator="request">
    <ows:ExceptionText>Could not determine geoserver request from http request org.geoserver.platform.AdvancedDispatchFilter$AdvancedDispatchHttpRequest@66acc6c5</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>
  • Do you have some reason for not reading the GetCapabilities with curl and GET? – user30184 Oct 25 '17 at 20:13
  • No, but that doesn't seem to work either. – medley56 Oct 25 '17 at 20:15
  • You mean that curl "http://my.geoserver.url/geoserver/wfs?service=wfs&version=2.0.0&request=GetCapabilities"does not work? Or with single quotes if you are on Linux? – user30184 Oct 25 '17 at 20:40
  • What do mean with WFS 2.0 specific temporal filtering, that does not work with other versions? – user30184 Oct 25 '17 at 20:59
  • in both cases I think the content-type should be text/xml while the accept type should be application/gml+xml;version=3.2 - I doubt it makes a difference though – Ian Turton Oct 26 '17 at 8:04
1

Short answer: The primary place to search information about how to use WFS standard is the standart itself.

Have a look at the current WFS 2.0.2 standard at http://docs.opengeospatial.org/is/09-025r2/09-025r2.html and from the section B.7 GetCapabilities example you can find this.

<?xml version="1.0" ?>
<GetCapabilities
   service="WFS"
   version="2.0.2"
   xmlns="http://www.opengis.net/wfs/2.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.opengis.net/wfs/2.0
                       http://schemas.opengis.net/wfs/2.0/wfs.xsd"/>

I tested that request document with the demo request utility that comes with GeoServer and it did work. I had to remove the line <?xml version="1.0" ?>" I guess because the application is adding it automatically. Using version 2.0.2 that GeoServer does not support was not critical but GeoServer answered with the highest version that it supports, 2.0.0.

Then I saved the XML from the WFS standard as is into a file and used your curl command with my local GeoServer

curl -X POST -H "Content-type: application/gml+xml;version=3.2" -d @GetCapabilities.xml http://localhost:8080/geoserver/wfs

That worked as well.

0

The 1.0.0 and 1.1.0 requests didn't include the version in the namespace, but 2.0.0 requires it (tested with GeoServer 2.10.1): xmlns="http://www.opengis.net/wfs/2.0".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.