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

Issue with clean_ows_url in wps.py when connecting to PyQGIS-WPS #902

Closed
jemacchi opened this issue Jan 12, 2024 · 4 comments
Closed

Issue with clean_ows_url in wps.py when connecting to PyQGIS-WPS #902

jemacchi opened this issue Jan 12, 2024 · 4 comments
Labels

Comments

@jemacchi
Copy link

When attempting to execute a process against a PyQGIS-WPS server, the WebProcessingService object should be defined as

...
wps = WebProcessingService('http://'+WPS_SERVER+'/ows/?SERVICE=WPS&VERSION=1.0.0&MAP='+WPS_MAP, skip_caps=True)
...

since it's necessary to define: VERSION and SERVICE attributes for the URL (as minimal).

As the wps object is cleaning the URL in the initialization (removing the service, version and request using the function clean_ows_url) then when the wps.execute method is called, the server side (pyQGIS-WPS in this case) does not recognize the request as valid (cause it's expecting those 2 parameters to exist)

There is no problem with getCapabilities or DescribeProcess requests, since the URL is clean and then regenerated by the client (owslib) adding the parameters by itself. The problem only arise when trying to execute. The owslib assumption about no need of any kind of parameter on the URL is not completely right.

Probably, from an owslib perspective, it would be a matter of adjusting the server side to work without parameters in the URL, but since changing the code in pyqgis-wps is much more complex than in the owslib code base, I just fixed the issue avoiding the clean function in this line https://github.com/geopython/OWSLib/blob/master/owslib/wps.py#L243

I would like to know if there was a strong reason to decide to clean the URL for those 3 parameters on the initialization. Do I miss something about that ? is it just a matter of forcing to attach to standard ? or to something like not having url get parameters in a post request ? (if that is the case, sorry but PyQGIS-Server is working that way, so for me, it was much easier to relax the client than just to force something in the server).

any comment will be welcome, and if it's something that can be pushed as improvement, I can help with that (even including some extra stuff if considered as needed)

Copy link

github-actions bot commented Oct 6, 2024

This Issue has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days.

@github-actions github-actions bot added the stale label Oct 6, 2024
@jemacchi
Copy link
Author

jemacchi commented Oct 7, 2024

any comment ?

@geographika
Copy link
Contributor

@jemacchi - looks like the reasoning is outlined in #374 and the pull request #375.
When you create your WPS shouldn't you be passing in the version etc. as parameters?

wps = WebProcessingService('http://'+WPS_SERVER+'/ows/?', version="1.0.0", ..

@jemacchi
Copy link
Author

I will take a look using the parameter as you mention. The reference to the mentioned issue (#374) helps to have an understanding on reasons behind the sanitize process.
As mentioned, I think that probably my "topic" is a matter of the combination of the client with the server side (pyqgiswps). Latest one needs to receive the service and version as parameters too (when calling execute). Maybe the use of those as parameters as you shown me is doing some workaround/exception which I did not realize when reading codebase.
Thanks !

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

No branches or pull requests

2 participants