[GeoNode-devel] Unable to use OWSLib get_schema function when the permission's layer is not viewable from Anyone

Dimitris Karakostis karakostis.dimitris at gmail.com
Thu Sep 22 04:51:30 PDT 2016


I use OWSLib (0.12.0) to retrieve the schema of a layer from Geoserver:

   wfs = WebFeatureService(location, version='1.1.0')
   schema = wfs.get_schema(name_of_layer)

This works fine as long as the checkbox: Anyone (in the permissions modal:
Who can view it tab)  for this layer is selected.
If I uncheck the checkbox I get an error related to:

    schema = wfs.get_schema(name_of_layer)

I also tried to pass authentication parameters to the WebFeatureService as
described here (https://goo.gl/ffpHg7) but this doesn't
seem to fix the issue.

This is the error I get:

Traceback:
File
"/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/django/core/handlers/base.py"
in get_response
  112.                     response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File
"/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/django/contrib/auth/decorators.py"
in _wrapped_view
  22.                 return view_func(request, *args, **kwargs)
File "/home/vagrant/geonode/geonode/layers/views.py" in layer_edit_data
  1171.     schema = wfs.get_schema(name)
File
"/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/owslib/feature/__init__.py"
in get_schema
  157.         return get_schema(self.url, typename, self.version)
File
"/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/owslib/feature/schema.py"
in get_schema
  40.     res = openURL(url, timeout=timeout)
File
"/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/owslib/util.py"
in openURL
  213.             raise
ServiceException(str(serviceException.text).strip())

Exception Type: ServiceException at
/layers/geonode:afghanistan_asdasdas/edit_data
Exception Value:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20160922/c43e2d15/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2016-09-22 at 1.38.52 PM.png
Type: image/png
Size: 53873 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20160922/c43e2d15/attachment-0001.png>


More information about the geonode-devel mailing list