Question

Error in the connection string using WMS reader. Duplet username and password.

  • 15 February 2021
  • 7 replies
  • 2 views

I get an error when I use the WMS reader. I add the the URL as:

"https://wms.abc/ServicesWhen /abc.Proxy/wmsserver.ashx?password=yyy&username=xxx"

 

That works, as I can see the layers from which I chose the one I want to load in.

I dont select any "Network Authentication" option.

I leave the Map options as get filled out from WMSs metadata.

After pressing OK, the reader is successfully shown on my canvas.

 

When i want to run this reader, without having it connected to anything, it stops with a fatal error. I can see it made a WMS URL, where the username and password are used at the start and also end of the URL. That is also failing if I place it in a browser. But just by removing the closing un/pw, it all works in the browser.

 

Does anyone know what induces this double credential issue?

 

 

https://wms.abc/Services/abc.Proxy/wmsserver.ashx?username=xxx&password=yyy&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=DK-DDOland1995_80cm_UTM32ETRS89&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=7.31147337604259%2C50.1385824126281%2C20.9942842160309%2C57.9285119921709&WIDTH=560&HEIGHT=318&EXCEPTIONS=application%2Fvnd.ogc.se_xml&password=yyy&username=xxx

 

Thanks 😃


7 replies

Badge

Hello,

 

Are you able to retrieve/download the WMS capabilities and view it in a text editor or browser?

 

What does the xlink:href for the GetMap's OnlineResource look like?

 

For example, the WMS capabilities at:

 

https://mesonet.agron.iastate.edu/cgi-bin/wms/iowa/rainfall.cgi?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1

 

has:

 

 <GetMap>

   <DCPType>

    <HTTP>

     <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://mesonet.agron.iastate.edu/cgi-bin/wms/iowa/rainfall.cgi?"/></Get>

    </HTTP>

   </DCPType>

  </GetMap>

 

The WMS reader will append the extra keyword/value pairs specified in the Dataset at the end of the generated GetMap URL. The URL will be based on the xlink:href OnlineResource for GetMap specified as above.

Hello, 

 

Are you able to retrieve/download the WMS capabilities and view it in a text editor or browser?

 

 What does the xlink:href for the GetMap's OnlineResource look like?  

 

For example, the WMS capabilities at:

 

https://mesonet.agron.iastate.edu/cgi-bin/wms/iowa/rainfall.cgi?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1

 

has:

 

 <GetMap>

   <DCPType>

    <HTTP>

     <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://mesonet.agron.iastate.edu/cgi-bin/wms/iowa/rainfall.cgi?"/></Get>

    </HTTP>

   </DCPType>

  </GetMap>

 

The WMS reader will append the extra keyword/value pairs specified in the Dataset at the end of the generated GetMap URL.  The URL will be based on the xlink:href OnlineResource for GetMap specified as above.

  

Hey Juan

Yes, I can get the capabilities. But only if I manually remove the duplet login from the generated URL, otherwise I get an error file saying "Login error."

 

This is how it looks under <GetMap>:

 

<Get>

<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://wms.abc/Services/abc.Proxy/wmsserver.ashx?username=xxx&password=yyy"/>

</Get>

 

 

And the problem is not unique to my Co's WMS. I get the same error on a local, governmental WMS, when I attempt to call it with the reader. Here below you can see an other service and tried to reach. First the Capabilities were get well (line 11) , and then it failed with the layer. 

Creating reader for format: 
MULTI_READER(MULTI_READER): Will fail with first member reader failure
MULTI_READER(MULTI_READER): Adding WMS Reader with keyword WMS_3
Using Multi Reader with keyword `MULTI_READER' to read multiple datasets
Creating reader for format: WMS (Web Map Service)
Trying to find a DYNAMIC plugin for reader named `WMS'
Loaded module 'WMS' from file 'C:\Program Files\FME\plugins/WMS.dll'
FME API version of module 'WMS' matches current internal version (3.8 20200115)
<WMS> Capabilities URL: `https://services.datafordeler.dk:443/GeoDanmarkOrto/orto_foraar/1.0.0/WMS?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1&username=xxxxxx&password=yyyyyyy'.
Starting HTTP download from 'services.datafordeler.dk'
HTTP transfer summary - status code: 200, download size: '27963 bytes', DNS lookup time: '0.000917 seconds', total transfer time: '0.402625 seconds', url: 'https://services.datafordeler.dk:443/GeoDanmarkOrto/orto_foraar/1.0.0/WMS?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1&username=xxxxxx&password=yyyyyyy'
FME API version of module 'NULL' matches current internal version (3.8 20200115)
FME API version of module 'NULL' matches current internal version (3.8 20200115)
Loaded module 'LogCount_func' from file 'C:\Program Files\FME\plugins/LogCount_func.dll'
FME API version of module 'LogCount_func' matches current internal version (3.8 20200115)
<WMS> GetMap URL: `https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/Wms?username=xxxxxx&password=yyyyyyy&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=geodanmark_2017_10cm&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=7.99125%2C54.4258%2C15.6162%2C57.778&WIDTH=560&HEIGHT=246&EXCEPTIONS=application%2Fvnd.ogc.se_xml&username=xxxxxx&password=yyyyyyy'.
Starting HTTP download from 'services.datafordeler.dk'
HTTP transfer summary - status code: 400, download size: '58 bytes', DNS lookup time: '3.2e-5 seconds', total transfer time: '0.098328 seconds', url: 'https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/Wms?username=xxxxxx&password=yyyyyyy&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=geodanmark_2017_10cm&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=7.99125%2C54.4258%2C15.6162%2C57.778&WIDTH=560&HEIGHT=246&EXCEPTIONS=application%2Fvnd.ogc.se_xml&username=xxxxxx&password=yyyyyyy'
Received HTTP response header: 'HTTP/1.1 400 Bad Request' from 'https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/Wms?username=xxxxxx&password=yyyyyyy&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=geodanmark_2017_10cm&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=7.99125%2C54.4258%2C15.6162%2C57.778&WIDTH=560&HEIGHT=246&EXCEPTIONS=application%2Fvnd.ogc.se_xml&username=xxxxxx&password=yyyyyyy'
A fatal error has occurred. Check the logfile above for details
Translation FAILED with 2 error(s) and 0 warning(s) (0 feature(s) output)
FME Session Duration: 2.2 seconds. (CPU: 0.1s user, 0.3s system)
END - ProcessID: 13108, peak process memory usage: 51092 kB, current process memory usage: 50148 kB
A fatal error has occurred. Check the logfile above for details
Program Terminating
Translation FAILED.

 

Badge

Hey Juan

Yes, I can get the capabilities. But only if I manually remove the duplet login from the generated URL, otherwise I get an error file saying "Login error."

 

This is how it looks under <GetMap>:

 

<Get>

<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://wms.abc/Services/abc.Proxy/wmsserver.ashx?username=xxx&password=yyy"/>

</Get>

 

 

And the problem is not unique to my Co's WMS. I get the same error on a local, governmental WMS, when I attempt to call it with the reader. Here below you can see an other service and tried to reach. First the Capabilities were get well (line 11) , and then it failed with the layer. 

Creating reader for format: 
MULTI_READER(MULTI_READER): Will fail with first member reader failure
MULTI_READER(MULTI_READER): Adding WMS Reader with keyword WMS_3
Using Multi Reader with keyword `MULTI_READER' to read multiple datasets
Creating reader for format: WMS (Web Map Service)
Trying to find a DYNAMIC plugin for reader named `WMS'
Loaded module 'WMS' from file 'C:\Program Files\FME\plugins/WMS.dll'
FME API version of module 'WMS' matches current internal version (3.8 20200115)
<WMS> Capabilities URL: `https://services.datafordeler.dk:443/GeoDanmarkOrto/orto_foraar/1.0.0/WMS?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1&username=xxxxxx&password=yyyyyyy'.
Starting HTTP download from 'services.datafordeler.dk'
HTTP transfer summary - status code: 200, download size: '27963 bytes', DNS lookup time: '0.000917 seconds', total transfer time: '0.402625 seconds', url: 'https://services.datafordeler.dk:443/GeoDanmarkOrto/orto_foraar/1.0.0/WMS?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1&username=xxxxxx&password=yyyyyyy'
FME API version of module 'NULL' matches current internal version (3.8 20200115)
FME API version of module 'NULL' matches current internal version (3.8 20200115)
Loaded module 'LogCount_func' from file 'C:\Program Files\FME\plugins/LogCount_func.dll'
FME API version of module 'LogCount_func' matches current internal version (3.8 20200115)
<WMS> GetMap URL: `https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/Wms?username=xxxxxx&password=yyyyyyy&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=geodanmark_2017_10cm&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=7.99125%2C54.4258%2C15.6162%2C57.778&WIDTH=560&HEIGHT=246&EXCEPTIONS=application%2Fvnd.ogc.se_xml&username=xxxxxx&password=yyyyyyy'.
Starting HTTP download from 'services.datafordeler.dk'
HTTP transfer summary - status code: 400, download size: '58 bytes', DNS lookup time: '3.2e-5 seconds', total transfer time: '0.098328 seconds', url: 'https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/Wms?username=xxxxxx&password=yyyyyyy&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=geodanmark_2017_10cm&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=7.99125%2C54.4258%2C15.6162%2C57.778&WIDTH=560&HEIGHT=246&EXCEPTIONS=application%2Fvnd.ogc.se_xml&username=xxxxxx&password=yyyyyyy'
Received HTTP response header: 'HTTP/1.1 400 Bad Request' from 'https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/Wms?username=xxxxxx&password=yyyyyyy&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=geodanmark_2017_10cm&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=7.99125%2C54.4258%2C15.6162%2C57.778&WIDTH=560&HEIGHT=246&EXCEPTIONS=application%2Fvnd.ogc.se_xml&username=xxxxxx&password=yyyyyyy'
A fatal error has occurred. Check the logfile above for details
Translation FAILED with 2 error(s) and 0 warning(s) (0 feature(s) output)
FME Session Duration: 2.2 seconds. (CPU: 0.1s user, 0.3s system)
END - ProcessID: 13108, peak process memory usage: 51092 kB, current process memory usage: 50148 kB
A fatal error has occurred. Check the logfile above for details
Program Terminating
Translation FAILED.

 

Thank you, there's onne thing I don't understand:

 

"Yes, I can get the capabilities. But only if I manually remove the duplet login from the generated URL, otherwise I get an error file saying "Login error.""

 

The URL generated by the FME WMS to retrieve the capabilities shouldn't have the duplicated credentials,  the generated capabilities URL should not depend on any base URL from the server. 

 

But this seems to explain the problem, somehow the set of WMS servers are, not sure about the reasoning, creating  WMS capabilities document with the username/password embedded in the  GetMap xlink:href onlineResource, from your snippet:

 

<Get>

<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://wms.abc/Services/abc.Proxy/wmsserver.ashx?username=xxx&password=yyy"/>

</Get>

 

The FME WMS reader as explained earlier will  append any keyword/value pairs (these are usually vendor specific parameters) in the URL Dataset to the Capabilities GetMap.  OnlineResource URL for its GetMap request.  

 

 

Badge +8

Hi @daniszucs92​ 

I have filed an investigative task to check if there is anything we can do to get such services to return valid data. I will update you once we conduct some additional testing and reproduce the issue internally.

Hi @daniszucs92​ 

I have filed an investigative task to check if there is anything we can do to get such services to return valid data. I will update you once we conduct some additional testing and reproduce the issue internally.

Thank you (:

Badge +6

Hi @daniszucs92​ 

I have filed an investigative task to check if there is anything we can do to get such services to return valid data. I will update you once we conduct some additional testing and reproduce the issue internally.

Nothing came up??

Userlevel 2
Badge +10

Nothing came up??

Hi @mathiku​, I've taken a look into this and the issue with the WMS Reader failing to read URLs containing usernames and passwords was fixed in FME 2021.1. If you have any other questions please let me know!

Reply