Hello,

I briefly tried the new GeoTools 12 beta. I was interested in the new 
"gt-wfs-ng" module.
Sadly it didn't work for me. There is some strange XSD-Shema and XML output. 
Maybe it is my fault? Could anybody please try this WFS with the new module.
The Code is working fine with GeoTools 11.1. Mybe I did something wrong?

Here is the Code:
-----------------------------------------------
String getCapabilities = 
"http://suite.opengeo.org/geoserver/wfs?service=wfs&version=1.1.0&request=GetCapabilities";;
Map<String, String> connectionParameters = new HashMap<>();
connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", 
getCapabilities );

DataStore dataStore = DataStoreFinder.getDataStore( connectionParameters );

String featureTypeName = dataStore.getTypeNames()[0];

SimpleFeatureSource simpleFeatureSource = 
dataStore.getFeatureSource(featureTypeName);

SimpleFeatureCollection simpleFeatureCollection = 
simpleFeatureSource.getFeatures();

int i = 0;
try (SimpleFeatureIterator iterator = simpleFeatureCollection.features()){
  while( i < 5 && iterator.hasNext() ){
    SimpleFeature feature = iterator.next();
    System.out.println("Feature " + i + ": " + "\n" + feature);
    i++;
  }
}


Here is the Console output:
-----------------------------------------------
Jul 31, 2014 4:45:37 PM org.geotools.data.wfs.internal.WFSClient 
determineCorrectStrategy
Information: Using WFS Strategy: 
org.geotools.data.wfs.internal.v1_x.GeoServerPre200Strategy
Jul 31, 2014 4:45:37 PM org.geotools.data.wfs.internal.Loggers log
Information: Sending DFT request to 
http://suite.opengeo.org/geoserver/wfs?REQUEST=DescribeFeatureType&VERSION=1.1.0&SERVICE=WFS
Jul 31, 2014 4:45:37 PM org.geotools.xml.impl.AttributeEncodeExecutor visit
Warnung: Binding: {http://www.opengis.net/ows}ServiceType does not declare a 
target type
Jul 31, 2014 4:45:37 PM org.geotools.data.wfs.internal.Loggers log
Information: Encoded DESCRIBE_FEATURETYPE request: <?xml version="1.0" 
encoding="UTF-8"?><wfs:DescribeFeatureType 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:medford="http://medford.opengeo.org"; 
xmlns:ogc="http://www.opengis.net/ogc"; xmlns:wfs="http://www.opengis.net/wfs"; 
xmlns:ows="http://www.opengis.net/ows"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:gml="http://www.opengis.net/gml"; handle="GeoTools 
12-beta(83e50a7ca63f11227d5840463c105ddf6a44330a) WFS 1.1.0 DataStore 
@IVI-STUDPC-086#1" outputFormat="text/xml; subtype=gml/3.1.1" service="WFS" 
version="1.1.0">
 <wfs:TypeName>medford:hydro</wfs:TypeName>
</wfs:DescribeFeatureType>

<?xml version="1.0" encoding="UTF-8"?><wfs:DescribeFeatureType 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:medford="http://medford.opengeo.org"; 
xmlns:ogc="http://www.opengis.net/ogc"; xmlns:wfs="http://www.opengis.net/wfs"; 
xmlns:ows="http://www.opengis.net/ows"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:gml="http://www.opengis.net/gml"; handle="GeoTools 
12-beta(83e50a7ca63f11227d5840463c105ddf6a44330a) WFS 1.1.0 DataStore 
@IVI-STUDPC-086#1" outputFormat="text/xml; subtype=gml/3.1.1" service="WFS" 
version="1.1.0">
 <wfs:TypeName>medford:hydro</wfs:TypeName>
</wfs:DescribeFeatureType>

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:gml="http://www.opengis.net/gml"; 
xmlns:medford="http://medford.opengeo.org"; xmlns:opengeo="http://opengeo.org"; 
xmlns:usa="http://census.gov"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified" targetNamespace="http://medford.opengeo.org";>
  <xsd:import namespace="http://www.opengis.net/gml"; 
schemaLocation="http://suite.opengeo.org/geoserver/schemas/gml/3.1.1/base/gml.xsd"/>
  <xsd:complexType name="hydroType">
    <xsd:complexContent>
      <xsd:extension base="gml:AbstractFeatureType">
        <xsd:sequence>
          <xsd:element maxOccurs="1" minOccurs="0" name="the_geom" 
nillable="true" type="gml:MultiLineStringPropertyType"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="LENGTH" 
nillable="true" type="xsd:long"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="STREAM" 
nillable="true" type="xsd:string"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="STREAM_NAM" 
nillable="true" type="xsd:string"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="LINE_ID" 
nillable="true" type="xsd:string"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="len" nillable="true" 
type="xsd:double"/>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:element name="hydro" substitutionGroup="gml:_Feature" 
type="medford:hydroType"/>
</xsd:schema>
Jul 31, 2014 4:45:37 PM org.geotools.feature.simple.SimpleFeatureTypeBuilder add
Warnung: Creating location with null CoordinateReferenceSystem - did you mean 
to setCRS?
Jul 31, 2014 4:45:37 PM org.geotools.feature.simple.SimpleFeatureTypeBuilder add
Warnung: Creating the_geom with null CoordinateReferenceSystem - did you mean 
to setCRS?
Jul 31, 2014 4:45:37 PM org.geotools.data.wfs.internal.Loggers log
Information: Sending GetFeature request to 
http://suite.opengeo.org/geoserver/wfs?REQUEST=GetFeature&VERSION=1.1.0&SERVICE=WFS
Jul 31, 2014 4:45:38 PM org.geotools.xml.impl.AttributeEncodeExecutor visit
Warnung: results[ class java.lang.String ] is not of type class 
net.opengis.wfs.ResultTypeType
Jul 31, 2014 4:45:38 PM org.geotools.xml.impl.AttributeEncodeExecutor visit
Warnung: Binding: {http://www.opengis.net/ows}ServiceType does not declare a 
target type
Jul 31, 2014 4:45:38 PM org.geotools.xml.impl.AttributeEncodeExecutor visit
Warnung: Binding: {http://www.opengis.net/wfs}Base_TypeNameListType does not 
declare a target type
Jul 31, 2014 4:45:38 PM org.geotools.xml.impl.AttributeEncodeExecutor visit
Warnung: Binding: {http://www.opengis.net/wfs}TypeNameListType does not declare 
a target type
Jul 31, 2014 4:45:38 PM org.geotools.data.wfs.internal.Loggers log
Information: Encoded GET_FEATURE request: <?xml version="1.0" 
encoding="UTF-8"?><wfs:GetFeature xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:medford="http://medford.opengeo.org"; 
xmlns:ogc="http://www.opengis.net/ogc"; xmlns:wfs="http://www.opengis.net/wfs"; 
xmlns:ows="http://www.opengis.net/ows"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:gml="http://www.opengis.net/gml"; handle="GeoTools 
12-beta(83e50a7ca63f11227d5840463c105ddf6a44330a) WFS 1.1.0 DataStore @XXX#1" 
outputFormat="text/xml; subtype=gml/3.1.1" resultType="results" service="WFS" 
version="1.1.0">
 <wfs:Query srsName="urn:x-ogc:def:crs:EPSG:4326" typeName="medford:hydro"/>
</wfs:GetFeature>

<?xml version="1.0" encoding="UTF-8"?><wfs:GetFeature 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:medford="http://medford.opengeo.org"; 
xmlns:ogc="http://www.opengis.net/ogc"; xmlns:wfs="http://www.opengis.net/wfs"; 
xmlns:ows="http://www.opengis.net/ows"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:gml="http://www.opengis.net/gml"; handle="GeoTools 
12-beta(83e50a7ca63f11227d5840463c105ddf6a44330a) WFS 1.1.0 DataStore @XXX#1" 
outputFormat="text/xml; subtype=gml/3.1.1" resultType="results" service="WFS" 
version="1.1.0">
 <wfs:Query srsName="urn:x-ogc:def:crs:EPSG:4326" typeName="medford:hydro"/>
</wfs:GetFeature>
-----------------------------------------------

I'd be thankful for any reply.

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to