Skip to main content
Question

Generic reading GML on a web yields http 404

  • 15 July 2024
  • 3 replies
  • 21 views

Hello, I am trying to read data of different formats, controlled by a resource list. I isolate web services with a separate WFS FeatureReader, I do not have database resources and for the other resources I use a Generic FeatureReader, with the REAL_FORMAT parameter set to:

<Guess format name from extension>

Some resources include gml files on a web location (URL). The Generic FeatureReader usually reads them correctly, with one exception that gives an http 404 error (Not Found). I can avoid the error by choosing OGC GML (Geography Markup Language) for the REAL_FORMAT parameter. But I cannot control this from my resource list, only with a published parameter. I have tried adding an OGC GML resource reader, but this does not help. The Guess format parameter apparently does not make the right choice.

Does anyone have an idea how to solve this, without adding a tester with a separate FeatureReader or using a WorkspaceRunner?

I'm using FME Form 2022.2.4 (Win)

Below an extract of the workspace log. 

Creating reader for format: Generic (Any Format)
Trying to find a DYNAMIC plugin for reader named `GENERIC'
Loaded module 'GENERIC' from file 'C:\Program Files\FME2022\plugins/GENERIC.dll'
FME API version of module 'GENERIC' matches current internal version (4.0 20220615)
Performing query against GENERIC dataset `https://geoservices.xxxxxxxxxxxxx.nl/bestanden/INSPIRE/nlps-st.gml'
Creating reader for format: Generic (Any Format)
Trying to find a DYNAMIC plugin for reader named `GENERIC'
Generic Reader: No valid reader name specified, guessing reader name from dataset 'https://geoservices.xxxxxxxxxxxxx.nl/bestanden/INSPIRE/nlps-st.gml'
Generic Reader: Reader name 'AIXM5' guessed from dataset 'https://geoservices.xxxxxxxxxxxxx.nl/bestanden/INSPIRE/nlps-st.gml'
Generic Reader: No format specific settings have been found for the AIXM5 Reader -- default values as documented in the Reader/Writer manual will be used
Creating reader for format: AIXM 5.x (Aeronautical Information Exchange Model GML version 5.x)
Trying to find a DYNAMIC plugin for reader named `AIXM5'
Opening the GENERIC Reader on dataset `https://geoservices.xxxxxxxxxxxxx.nl/bestanden/INSPIRE/nlps-st.gml'
<R_14 - AIXM5 Reader> - Opening the R_14 - AIXM5 Reader reader with source dataset 'https://geoservices.xxxxxxxxxxxxx.nl/bestanden/INSPIRE/nlps-st.gml'
The uri-map document 'C:\Program Files\FME2022\xml\urimap\gml_aixm.xml' is being used to map from URI to URI
The uri-map document 'C:\Program Files\FME2022\xml\urimap\gml_citygml.xml' is being used to map from URI to URI
The uri-map document 'C:\Program Files\FME2022\xml\urimap\gml_inspire.xml' is being used to map from URI to URI
The uri-map document 'C:\Program Files\FME2022\xml\urimap\gml_sosi.xml' is being used to map from URI to URI
The uri-map document 'C:\Program Files\FME2022\xml\urimap\gml_urimap.xml' is being used to map from URI to URI
Sending HTTP 'GET' request to 'https://geoservices.xxxxxxxxxxxxx.nl/bestanden/INSPIRE/nlps-st.gml', waiting for response ...
Parsing XML document 'https://geoservices.xxxxxxxxxxxxx.nl/bestanden/INSPIRE/nlps-st.gml'
Received HTTP response header: 'HTTP/1.1 200 OK'
Received HTTP response header: 'Content-Type: application/gml+xml'
Received HTTP response header: 'Last-Modified: Wed, 26 Aug 2020 13:38:28 GMT'
Received HTTP response header: 'Accept-Ranges: bytes'
Received HTTP response header: 'ETag: "a548892eae7bd61:0"'
Received HTTP response header: 'Server: Microsoft-IIS/10.0'
Received HTTP response header: 'X-Powered-By: ASP.NET'
Received HTTP response header: 'Date: Mon, 15 Jul 2024 13:05:17 GMT'
Received HTTP response header: 'Content-Length: 195101'
Received HTTP response header: 'X-Content-Type-Options: NOSNIFF'
Received HTTP response header: 'X-Content-Type-Options: SAMEORIGIN'
Received HTTP response header: 'Strict-Transport-Security: max-age=15552000; includeSubDomains; preload'
URI 'nlps-st.xsd' mapped to 'https://geoservices.xxxxxxxxxxxxx.nl/bestanden/INSPIRE/nlps-st.xsd'
>1]: Starting HTTP download from 'geoservices.xxxxxxxxxxxxx.nl'. Expected transfer size: 1245 bytes
>1]: HTTP Download: received 1245 bytes
>1]: HTTP transfer summary (geoservices.xxxxxxxxxxxxx.nl): status code: 404, download size: 1245 bytes, DNS lookup time: 2 ms, total transfer time: 75 ms
>1]: Received HTTP response header: 'HTTP/1.1 404 Not Found' from 'https://geoservices.xxxxxxxxxxxxx.nl/bestanden/INSPIRE/nlps-st.xsd'
An error has occurred. Check the logfile above for details
An error has occurred. Check the logfile above for details
Closing the GENERIC Reader

 

3 replies

Badge +24

Could you try using a HTTPCaller or a FeatureReader set to text file reading?

It looks like the Generic Reader sees a GML and thinks it should look for the XSD file. But this XSD file does not exist on the specified location.

Ignoring XSD files could help.

Userlevel 1
Badge +12

Hi Jasper, yes indeed, loosing the XSD is helping, however not really needed since even the Generic Reader, when instructed to use the OGC GML reader and not explicitly excluding the XSD, succeeds reading the dataset. The HTTPCaller (or FeatureReader in Textfile mode) sadly doesn't read any other formats.

I'm was even trying to find some way (scripted parameter) to set the REAL_FORMAT, yet the url of the sourcefile is not available when starting the workspace and I cannot set the real format using an attribute (as well as adding a resource GML reader didn't fix the issue).  

Userlevel 1
Badge +12

I even used an attributeCreator, setting attribute ‘source_format’ to conditional value:

if my source file starts with http and ends with .gml:

   set it to GMLNOSCHEMA,

   otherwise leave it empty.

The parameter for the Generic FeatureReader now can get its value from the source_format attribute.

Like this:

AttributeCreator, setting source_format:

 

FeatureReader parameter setting:

 

It successfully reads features from all datasets, however, it produces a terrible lot of warning messages:

 

Reply