Hi Johann, Thank you for your explanation. In deed, the URL in the capabilities response doesn't point at an xsd file. the URL is replaced by the new one in the get feature response though. What about my second question? do you have any idea about the support of the version 2.0.0 of a WFS? Thank you :) Sincerly yours, -- Hanane
2016-08-03 17:55 GMT+02:00 johann sorel <[email protected]>: > Hello, > > I had a look to the WFS service url. > > The GeotoolKit client first reads the getCapabilities then tries to > rebuild the feature types from the different DescribeFeatureType requests. > The OGC moved the XSD schema locations a few years ago from > http://schemas.opengeospatial.net to http://schemas.opengis.net, but the > the WFS service on your url still refer to the old urls. > > For example : > Old URL : http://schemas.opengeospatial.net/gml/3.1.1/base/gml.xsd > New URL : http://schemas.opengis.net/gml/3.1.1/base/gml.xsd > > As a result the old url is redirected to http://schemas.opengis.net which > is not point to a xsd file. > And it causes a jaxb unmarshalling exception. > > > Johann Sorel > > > On 2016-07-30 16:58 ( 0200), Hanane Eljabiri wrote: > > Hello everyone,> > > > > I am a new user of this library and I have some difficulties to get> > > familiar with it.> > > > > My first question is: how can I get features from a wfs response using > SIS> > > (Gtk) library?> > > > > I%u2019ve tried to create a new WFS client, but unfortunately I > didn%u2019t find> > > neither tutorials nor examples showing how to do this.> > > > > So I tried the following code :> > > > > URL url=*new* URL("http://geoservices.brgm.fr/geologie?service=wfs" > <http://geoservices.brgm.fr/geologie?service=wfs>);> > > > > WebFeatureClient *wfs*=new WebFeatureClient(*url*, "1.1.0");> > > > > String [] names=wfs.getTypeNames();> > > > > With the code below, I%u2019ve got the following exceptions:> > > > > Avertissement: JAXB exception while reading imported schema:> > > http://schemas.opengeospatial.net/gml/3.1.1/base/gml.xsd> > > > > *javax.xml.bind.UnmarshalException*> > > > > - with linked exception:> > > > > [org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 55; Des> > > espaces sont obligatoires entre les ID publicId et systemId.]> > > > > at> > > > javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(> > > *AbstractUnmarshallerImpl.java:335*)> > > > > %u2026> > > > > Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: > 55;> > > Des espaces sont obligatoires entre les ID publicId et systemId.> > > > > at> > > > com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(> > > > *ErrorHandlerWrapper.java:198*)> > > > > ... 18 more> > > > > > > > > juil. 30, 2016 4:33:45 PM org.geotoolkit.feature.xml.Utils > getDistantSchema> > > > > Avertissement: Schema ressource not found:> > > http://schemas.opengeospatial.net/gml/3.1.1/base/gml.xsd> > > > > juil. 30, 2016 4:33:45 PM> > > org.geotoolkit.feature.xml.jaxb.JAXBFeatureTypeReader listAllSchemas> > > > > Avertissement: Unable to retrieve imported schema:> > > http://schemas.opengeospatial.net/gml/3.1.1/base/gml.xsd> > > > > Exception in thread "main" > *org.opengis.feature.MismatchedFeatureException*:> > > Unable to find complex type for name : {> > > http://www.opengis.net/gml}AbstractFeatureType> > > > > at org.geotoolkit.feature.xml.jaxb.JAXBFeatureTypeReader.getType(> > > *JAXBFeatureTypeReader.java:611*)> > > > > %u2026> > > > > > > > > I%u2019ve tried another way to get a response from the wfs server using > the> > > following code:> > > > > > > > > URL url=*new* URL("http://geoservices.brgm.fr/geologie?service=wfs" > <http://geoservices.brgm.fr/geologie?service=wfs>);> > > > > *final* Iterator ite = DataStores.*getAllFactories*> > > (ClientFactory.*class*).iterator();> > > > > *while*(ite.hasNext()){> > > > > * final* ClientFactory factory = ite.next();> > > > > * final* ParameterDescriptorGroup description = factory> > > .getParametersDescriptor();> > > > > * final* ParameterValueGroup params = description.createValue();> > > > > params.parameter("identifier").setValue("wfs");> > > > > params.parameter("url").setValue(url);> > > > > params.parameter("version").setValue("1.1.0");> > > > > * final* DataStore *server* = factory.create(params);> > > > > > > > > }> > > > > > > > > Using the code above, I%u2019ve got the following error:> > > > > Exception in thread "main" *org.apache.sis.storage.DataStoreException*: > Can> > > not create any new WFS DataStore> > > > > at org.geotoolkit.data.wfs.WFSFeatureStoreFactory.create(> > > *WFSFeatureStoreFactory.java:144*)> > > > > at org.geotoolkit.data.wfs.WFSFeatureStoreFactory.create(> > > *WFSFeatureStoreFactory.java:46*)> > > > > My second question is : Does the library support the version 2.0.0 of > wfs?> > > I tried to specify in parameters shown above the value %u201C2.0.0%u201D > but I%u2019ve got> > > an error saying : %u201C2.0.0%u201D is an unknow version value!> > > > > I am using java7 and this is an extract from my POM.xml:> > > > > > > > > > 4.0-M5> > > > > > > > > > > > > > > > > > > > > > > > org.geotoolkit> > > > > *geotk*-referencing> > > > > ${geotk.version}> > > > > > > > > > > > > > > org.geotoolkit> > > > > *geotk*-client-*wfs*> > > > > ${geotk.version}> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > *geotoolkit*> > > > > *Geotk* repository> > > > > http://maven.geotoolkit.org> > > > > > > > > > > > > > > > > > > > Thank you,> > > > > Best regards> > > > > >
