I'm trying to use Geotools 2.5.5 and the WFSExample.java example file to connect to a public WFS server and download a polygon shape file.
When I get to "Step 5" I get a ServiceException about the "Request" parameter missing. Is there something I need to do to add a Request parameter to my query? I've gone through the first couple pages of Google results and I found some reports that MapServer required "Service=wfs" added to the url. http://trac.osgeo.org/mapserver/ticket/1262 http://lists.osgeo.org/pipermail/mapserver-users/2007-November/026301.html Is that my problem? This page includes an example wfs link on the server I'd like to use, http://sdmdataaccess.nrcs.usda.gov/WebServiceHelp.aspx . The example link seems to work and includes SERVICE=WFS in the getFeature request. So, assuming this is the problem, Is there something easy I might do in the Geotools client code to work around it? Perhaps an api I could use to modify the url being generated before the request is executed? Or a way to add additional parameters to the request? Or perhaps a class I could extend and a method to override where I could recognize the hostname and add the parameter? I stepped into the WFS feature code with the debugger but it isn't immediately obvious to me where things are going wrong or where I might be able to modify the requests. Appreciate any feedback - even if it is just "yeah, thats your problem" Thanks, Ryan Here is the output of my program. **** Step 1: Connection Parameters **** Step 2: Connection **** Step 3: Discovery title:NRCS Soil Data Mart Data Access Web Feature Service WGS84 typeNames[0]=MapunitPoly typeNames[1]=MapunitPolyNoGeometry typeNames[2]=MapunitLine typeNames[3]=MapunitPoint typeNames[4]=MapunitPolyExtended typeNames[5]=SurveyAreaPoly using:MapunitPoly Schema Attributes:8 attributeDescriptor[0]=multiPolygon attributeDescriptor[1]=AREASYMBOL attributeDescriptor[2]=SPATIALVERSION attributeDescriptor[3]=MUSYM attributeDescriptor[4]=MUKEY attributeDescriptor[5]=SHAPE attributeDescriptor[6]=OBJECTID attributeDescriptor[7]=OBJECTID **** Step 4: target:MapunitPoly FeatureSource Bounds:ReferencedEnvelope[18.0 : 72.0, -178.5 : -66.0] **** Step 5: Query GeometryDescriptor LocalName: multiPolygon Built filter:[ multiPolygon intersects POLYGON ((-121.618652 38.231708, -121.313782 38.231708, -121.313782 38.440682, -121.618652 38.440682, -121.618652 38.231708)) ] Mar 4, 2010 5:32:07 PM org.geotools.xml.XMLSAXHandler processException SEVERE: Incomplete WFS request: 'Request' parameter missing. org.geotools.xml.filter.FilterComplexTypes$ServiceExceptionType.getValue(FilterComplexTypes.java:1669) org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:157) org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:266) org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) org.apache.xerces.parsers.XMLParser.parse(Unknown Source) org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) javax.xml.parsers.SAXParser.parse(Unknown Source) javax.xml.parsers.SAXParser.parse(Unknown Source) org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:140) org.geotools.data.wfs.v1_0_0.WFSFeatureReader.run(WFSFeatureReader.java:125) Mar 4, 2010 5:32:07 PM org.geotools.xml.XMLSAXHandler endElement WARNING: Incomplete WFS request: 'Request' parameter missing. Mar 4, 2010 5:32:07 PM org.geotools.xml.XMLSAXHandler endElement WARNING: Line 4 Col 72 Mar 4, 2010 5:32:07 PM org.geotools.data.wfs.v1_0_0.NonStrictWFSStrategy createFeatureReaderPOST WARNING: java.io.IOException: org.geotools.ows.ServiceException: Incomplete WFS request: 'Request' parameter missing. Mar 4, 2010 5:32:07 PM org.geotools.xml.XMLSAXHandler processException SEVERE: Invalid request. Unable to determine spatial filter. (Unknown, Unknown, Unknown). org.geotools.xml.filter.FilterComplexTypes$ServiceExceptionType.getValue(FilterComplexTypes.java:1669) org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:157) org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:266) org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) org.apache.xerces.parsers.XMLParser.parse(Unknown Source) org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) javax.xml.parsers.SAXParser.parse(Unknown Source) javax.xml.parsers.SAXParser.parse(Unknown Source) org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:140) org.geotools.data.wfs.v1_0_0.WFSFeatureReader.run(WFSFeatureReader.java:125) Mar 4, 2010 5:32:07 PM org.geotools.xml.XMLSAXHandler endElement WARNING: Invalid request. Unable to determine spatial filter. (Unknown, Unknown, Unknown). Mar 4, 2010 5:32:07 PM org.geotools.xml.XMLSAXHandler endElement WARNING: Line 4 Col 103 Mar 4, 2010 5:32:07 PM org.geotools.data.wfs.v1_0_0.NonStrictWFSStrategy createFeatureReaderGET WARNING: java.io.IOException: org.geotools.ows.ServiceException: Invalid request. Unable to determine spatial filter. (Unknown, Unknown, Unknown). java.util.NoSuchElementException: Could not aquire feature:java.io.IOException: org.geotools.ows.ServiceException: Invalid request. Unable to determine spatial filter. (Unknown, Unknown, Unknown). at org.geotools.data.store.NoContentIterator.next(NoContentIterator.java:56) at org.geotools.data.store.NoContentIterator.next(NoContentIterator.java:41) at hec.dgt.plugins.WFSExample.dataAccess(WFSExample.java:125) at hec.dgt.plugins.WFSExample.main(WFSExample.java:52) Caused by: java.io.IOException: org.geotools.ows.ServiceException: Invalid request. Unable to determine spatial filter. (Unknown, Unknown, Unknown). at org.geotools.xml.gml.FCBuffer.hasNext(FCBuffer.java:326) at org.geotools.data.wfs.v1_0_0.WFSFeatureReader.loadElement(WFSFeatureReader.java:189) at org.geotools.data.wfs.v1_0_0.WFSFeatureReader.hasNext(WFSFeatureReader.java:178) at org.geotools.data.ReTypeFeatureReader.hasNext(ReTypeFeatureReader.java:190) at org.geotools.data.wfs.v1_0_0.NonStrictWFSStrategy.createFeatureReaderGET(NonStrictWFSStrategy.java:134) at org.geotools.data.wfs.v1_0_0.NonStrictWFSStrategy.createFeatureReader(NonStrictWFSStrategy.java:101) at org.geotools.data.wfs.v1_0_0.StrictWFSStrategy.access$101(StrictWFSStrategy.java:60) at org.geotools.data.wfs.v1_0_0.StrictWFSStrategy$StrictFeatureReader.nextReader(StrictWFSStrategy.java:222) at org.geotools.data.wfs.v1_0_0.StrictWFSStrategy$StrictFeatureReader.init(StrictWFSStrategy.java:171) at org.geotools.data.wfs.v1_0_0.StrictWFSStrategy$StrictFeatureReader.<init>(StrictWFSStrategy.java:145) at org.geotools.data.wfs.v1_0_0.StrictWFSStrategy.createFeatureReader(StrictWFSStrategy.java:84) at org.geotools.data.wfs.v1_0_0.NonStrictWFSStrategy.getFeatureReader(NonStrictWFSStrategy.java:72) at org.geotools.data.wfs.v1_0_0.WFS_1_0_0_DataStore.getFeatureReader(WFS_1_0_0_DataStore.java:740) at org.geotools.data.DefaultFeatureResults.reader(DefaultFeatureResults.java:210) at org.geotools.data.store.DataFeatureCollection.openIterator(DataFeatureCollection.java:229) at org.geotools.data.store.DataFeatureCollection.iterator(DataFeatureCollection.java:199) at hec.dgt.plugins.WFSExample.dataAccess(WFSExample.java:122) ... 1 more Caused by: org.geotools.ows.ServiceException: Invalid request. Unable to determine spatial filter. (Unknown, Unknown, Unknown). at org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:274) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:140) at org.geotools.data.wfs.v1_0_0.WFSFeatureReader.run(WFSFeatureReader.java:125) Caused by: org.geotools.ows.ServiceException: Invalid request. Unable to determine spatial filter. (Unknown, Unknown, Unknown). at org.geotools.xml.filter.FilterComplexTypes$ServiceExceptionType.getValue(FilterComplexTypes.java:1669) at org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:157) at org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:266) ... 13 more ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
