Hi,

thanks for the advice about the parameter. I was not aware of this one 
until now.

I query features on an external WFS Version 2.0.0. In my case, geotools 
uses org.geotools.gml3.ApplicationSchemaXSD when looking for the location 
of the schemas to parse the DescribeFeatureTypeResponse.
I've added the second line in the addDependencies method here, so that for 
the namespace http://www.opengis.net/gml/3.2, the 
/org/geotools/gml3/v3_2/gml.xsd file from gt-xsd-gml3-28.1.jar is used as 
the schema.

public class ApplicationSchemaXSD extends XSD {
    /** application schema namespace */
    private String namespaceURI;

    /** location of the application schema itself */
    private String schemaLocation;

    public ApplicationSchemaXSD(String namespaceURI, String schemaLocation
) {
        this.namespaceURI = namespaceURI;
        this.schemaLocation = schemaLocation;
    }

    @Override
    protected void addDependencies(Set<XSD> dependencies) {
        dependencies.add(GML.getInstance());
        dependencies.add(org.geotools.gml3.v3_2.GML.getInstance());
    }

Kind regards
Susanne



Von:    "Roar Brænden" <roar.brenden...@gmail.com>
An:     "Susanne Köhn" <susanne.ko...@data-experts.de>
Kopie:  geotools-gt2-users@lists.sourceforge.net
Datum:  16.06.2023 07:35
Betreff:        Re: [Geotools-gt2-users] Problems with requesting Features 
from a WSF Version 2.0.0 and using a HTTP proxy



Hi,

That is good to hear. I don't see which ApplicationSchemaXSD you're 
talking about, or how you can customize it when you're using WFSClient.
Some code would be useful.

To avoid extensive download of schemas, it's possible to set the 
parameter: WFSDataStoreFactory:SCHEMA_CACHE_LOCATION.
You can see further explanation here.

Regards,
Roar Brænden

15. jun. 2023 kl. 15:17 skrev Susanne Köhn <susanne.ko...@data-experts.de
>:

Hello,

I tried your solution and it works. Thanks a lot!
However, in my case the performance has become worse compared to the WFS 
1.1.0 request. I found out that in ApplicationSchemaXSD for 
http://www.opengis.net/gml/3.2the local schema file 
org.geotools.gml3.v3_2.gml.xsd is not found. I added 
org.geotools.gml3.v3_2.GML in the addDependencies method in 
ApplicationSchemaXSD. Or is there another solution?

Kind regards
Susanne



Von:        "Roar Brænden" <roar.brenden...@gmail.com>
An:        "Susanne Köhn" <susanne.ko...@data-experts.de>
Kopie:        geotools-gt2-users@lists.sourceforge.net
Datum:        02.06.2023 10:06
Betreff:        Re: Antwort: Re: Antwort: Re: [Geotools-gt2-users] 
Problems with requesting Features from a WSF Version 2.0.0 and using a 
HTTP proxy



Hi,

I do understand your problem, but that is related to my problem with 
authentication. In the sense that it also is set at the HTTPClient.
I've made a PRin Github that I believe will fix the problem for both of 
us.

Hilsen Roar

2. jun. 2023 kl. 08:45 skrev Susanne Köhn <susanne.ko...@data-experts.de>:

Hello,

the main problem is that the HTTPURIHandler opens a connection to load the 
schemas without considering a proxy, even though the information is 
already present at the HTTPClient set at the WFSClient.

Kind Regards
Susanne


Von:        "Roar Brænden" <roar.brenden...@gmail.com>
An:        "Susanne Köhn" <susanne.ko...@data-experts.de>
Kopie:        geotools-gt2-users@lists.sourceforge.net
Datum:        31.05.2023 07:59
Betreff:        Re: Antwort: Re: [Geotools-gt2-users] Problems with 
requesting Features from a WSF Version 2.0.0 and using a HTTP proxy



Hi,

Good, then I will try to have a look at it.

Regards,
Roar

30. mai 2023 kl. 14:35 skrev Susanne Köhn <susanne.ko...@data-experts.de>:

Hello,

thanks for your reply, I have reported the problem as a bug.

Susanne



Von:        "Roar Brænden" <roar.brenden...@gmail.com>
An:        "Susanne Köhn" <susanne.ko...@data-experts.de>
Kopie:        geotools-gt2-users@lists.sourceforge.net
Datum:        26.05.2023 11:25
Betreff:        Re: [Geotools-gt2-users] Problems with requesting Features 
from a WSF Version 2.0.0 and using a HTTP proxy



Hi,

I?ve encounterred a similar problem, but that was related to 
authentication. It would be fine if you report this as a bug.

Then I will work more on my solution, so that it could be accepted into 
the code base.

Regards,
Roar Brænden

fre. 26. mai 2023 kl. 10:25 skrev Susanne Köhn <
susanne.ko...@data-experts.de>:
Hello,

I am using geotools Version 28.1. When requesting Features from a WSF 
Version 2.0.0 and using a HTTP proxy for the requests I get the following 
Exception.

java.lang.ClassCastException: java.util.HashMap cannot be cast to 
org.opengis.feature.simple.SimpleFeature
      at 
org.geotools.data.wfs.internal.parsers.PullParserFeatureReader.parse(
PullParserFeatureReader.java:119)
      at 
org.geotools.data.wfs.internal.parsers.PullParserFeatureReader.parse(
PullParserFeatureReader.java:47)
      at org.geotools.data.wfs.WFSFeatureReader.<init>(
WFSFeatureReader.java:54)
      at org.geotools.data.wfs.WFSFeatureSource.getReaderInternal(
WFSFeatureSource.java:290)
      at org.geotools.data.store.ContentFeatureSource.getReader(
ContentFeatureSource.java:636)
      at org.geotools.data.store.ContentFeatureCollection.features(
ContentFeatureCollection.java:173)
      at org.geotools.data.store.ContentFeatureCollection.features(
ContentFeatureCollection.java:52)

The problem is that the ParserHandler wants to load the Schema for the 
DescribeFeatureType URL directly. This leads to a 
java.net.SocketTimeoutException, because the used HTTP proxy is ignored.

Is there a way to tell the Parserhandler the Proxy Information? Or is 
there another way to load the Schema for the DescribeFeatureType?

Kind regards

Susanne _______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users








_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to