Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WMS resource doesn't work #2

Closed
drnextgis opened this issue Jan 28, 2016 · 10 comments
Closed

WMS resource doesn't work #2

drnextgis opened this issue Jan 28, 2016 · 10 comments

Comments

@drnextgis
Copy link

400 Bad Request

@wilhelmberg
Copy link
Collaborator

Have you tried the resource URL in your browser?
Does it work there?

@drnextgis
Copy link
Author

Plugin shows Online Resource URL (without REQUEST parameter) and if open this URL in browser you of course will get 400 HTTP error.

@wilhelmberg
Copy link
Collaborator

Plugin shows Online Resource URL (without REQUEST parameter)

The plugin shows the URL that was obtained from the CKAN Server.
If the URL misses some parameters it's most likely that the entry on the CKAN server that is faulty.

@drnextgis
Copy link
Author

It is clear that plugin shows the URL from the CKAN Server. But in this case (WMS, WFS services) resource URL is not direct URL to data but it only base part of this URL, the rest part (GET-parameters or POST payload) have to be defined by client application. I guess that in case of OWS services plugin should use already existed connections or open dialog window to create them.

@wilhelmberg
Copy link
Collaborator

I guess that in case of OWS services plugin should use already existed connections or open dialog window to create them.

Yes, that's exactly what the plugin does:

  • if the URL provided by the server is correct
  • if the URL gets correctly identified as WMS resource
  • if the URL (Capabilites) can be downloaded

How about you post the CKAN URL (does test connection in the settings work?) and the name of the data set you are trying to load?
Then we can take a look!

@drnextgis
Copy link
Author

CKAN URL: http://78.46.100.76/opendata

@ndkv
Copy link

ndkv commented Jan 28, 2016

The OWS endpoints and their parameters are a source of great confusion. Some catalogs indeed list only the base URL while others include e.g. request=GetCapabilities. Some serve WMS/WFS from separate endpoints while others serve both from /ows. Developing robust consumers of OWS endpoints is therefore quite a challenge.

@drnextgis Your WMSs are offered without parameters. Accessing e.g. http://78.46.100.76/opendata_ngw/api/resource/507/wms gives a 400, indeed.

@BergWerkGIS I might be wrong (or reading the wrong file) but it seems that you are looking for getcapabilities in the URL to determine whether you're dealing with an OWS resource? MIght this be causing the malfunction in this case?

@wilhelmberg
Copy link
Collaborator

@ndkv yes, looking for the capabilities URL

CKAN URL: http://78.46.100.76/opendata

@drnextgis that's the URL of the web page, you need the URL of the API.

The API URL is: http://78.46.100.76/opendata/api/3/

With that it works as expected:

image

To work with this plugin CKAN instance would have to return:

http://78.46.100.76/opendata_ngw/api/resource/567/wms?service=WMS&request=GetCapabilities

@drnextgis
Copy link
Author

Thanks for quick response. But I think it is not common way to identify WMS resource using request=GetCapabilities and plugin should check mandatary parameters (SERVICE, WMS) and if they is omitted it should add them while making request.

@wilhelmberg
Copy link
Collaborator

But I think it is not common way to identify WMS resource using request=GetCapabilities

I tend to disagree.
What's the first thing you do with an unknown WMS?
You ask it for its Capabilities and then continue from there on.
So why not expect to get that instead of fiddling with the URL?
So the data provider can for instance already provide his preferred VERSION too.

Other way round, why not:
WMS should check mandatary parameters (SERVICE, WMS) and if they are omitted it should add them while getting request.

Nevertheless I've created an issue to further investigate: #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants