Hi,
i am trying to read some feadures from a WFS:
URL url = new
URL("http://blabla/furtherbla/GisService?Service=wfs&Version=1.1.0&Request=GetCapabilities");
Map m = new HashMap();
m.put(WFSDataStoreFactory.URL.key, url.toString());
m.put(WFSDataStoreFactory.USERNAME.key, "me");
m.put(WFSDataStoreFactory.PASSWORD.key, "mysecret");
DataStore wfs = (new WFSDataStoreFactory()).createDataStore(m);
Query query = new DefaultQuery( wfs.getTypeNames()[3] );
FeatureReader ft = wfs.getFeatureReader( query, Transaction.AUTO_COMMIT);
Unfortunately this gives an exception for the last line:
Exception in thread "main" java.lang.IllegalArgumentException: Server does not
support 'text/xml; subtype=gml/3.1.1' output format: []
at
org.geotools.data.wfs.v1_1_0.DefaultWFSStrategy.getDefaultOutputFormat(DefaultWFSStrategy.java:110)
at
org.geotools.data.wfs.v1_1_0.WFS_1_1_0_Protocol.getDefaultOutputFormat(WFS_1_1_0_Protocol.java:685)
at
org.geotools.data.wfs.v1_1_0.WFS_1_1_0_DataStore.executeGetFeatures(WFS_1_1_0_DataStore.java:291)
at
org.geotools.data.wfs.v1_1_0.WFS_1_1_0_DataStore.getFeatureReader(WFS_1_1_0_DataStore.java:323)
If i do a getCapabilities-Request by hand (with the browser) it lists:
<wfs:OutputFormats>
<wfs:Format>text/xml; subtype=gml/3.1.1</wfs:Format>
<wfs:Format>text/xml; subtype=gml/2.1.2</wfs:Format>
</wfs:OutputFormats>
Why the exception?
Thank you,
Julian
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users