1

I'm using osgeo live to test the pycsw functionality. I need to harvest metadata from an existing Geoserver service (previously configure for this task).

I'm quite new with CSW and I'm not sure if my procedure is right. I've trie to follow the instrutions under: http://geopython.github.io/pycsw-workshop/docs/intro/intro-exercises.html#metadata-harvesting

My xml config file (called 'cat.xml') for the harvest is:

  <?xml version="1.0" encoding="UTF-8"?>
  <Harvest xmlns="http://www.opengis.net/cat/csw/2.0.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-publication.xsd" service="CSW" version="2.0.2">
    <Source>http://localhost:8082/geoserver/wms</Source>
    <ResourceType>http://www.opengis.net/wms</ResourceType>
    <ResourceFormat>application/xml</ResourceFormat>
  </Harvest>

for the source element I've used this one too (without exit):

<Source>http://localhost:8082/geoserver/cat/wms</Source>

I use the command:

$ cd /var/www/pycsw
$ python ./sbin/pycsw-admin.py -c post_xml -u http://localhost/pycsw/csw.py -x ~/cat.xml

Then I get the following error message:

Intializing static context
Executing HTTP POST request /home/user/cat.xml on server http://localhost/pycsw/csw.py
Traceback (most recent call last):
  File "./sbin/pycsw-admin.py", line 245, in <module>
    print admin.post_xml(CSW_URL, XML, TIMEOUT)
  File "/usr/lib/python2.7/dist-packages/pycsw/admin.py", line 506, in post_xml
    raise RuntimeError(err)
RuntimeError: HTTP Error 401: Unauthorized

The request GetCapabilities works:

localhost/pycsw/csw.py?config=tests/suites/default/default.cfg&service=CSW&version=2.0.2&request=GetCapabilites

Can you help me?

2 Answers 2

1

pycsw-admin.py does not currently support proxy. You can work around this with:

curl -x <[protocol://][user:password@]proxyhost[:port]> -X POST -d @cat.xml http://localhost/pycsw/csw.py

If this still gives you errors then this means that the proxy information has to pass through pycsw to be able to access the resource to be harvested.

If you open a ticket this would helpful in providing this in the next pycsw release.

1
  • Thaks Tom. I've opened a ticket. Jun 27, 2014 at 11:52
0

The response shows that the WMS has a login requirement. What happens when you try to invoke a GetCapabilities operation against the WMS? i.e.:

http://localhost:8082/geoserver/wms?service=WMS&version=1.1.1&request=GetCapabilities

You might also want to try some of the methods at http://pycsw.org/faq/#how-can-i-make-csw-post-xml-requests to further diagnose.

7
  • After invoke http://localhost:8082/geoserver/wms?service=WMS&version=1.1.1&request=GetCapabilities I get the file getcapabilities_1.1.1.xml. When I invoke http://localhost:8082/geoserver/wms?service=WMS&version=1.1.1&request=GetMap&layers=cat:cat&styles=&bbox=-180.0,-87.0,180.0,87.0&width=682¬height=330&srs=EPSG4326¬format=image7png I get the layer on the browser. Jun 26, 2014 at 9:18
  • What happens when you try curl -X POST -d @cat.xml http://localhost/pycsw/csw.py ? Jun 26, 2014 at 11:05
  • The response has an Access denied (authentication_failed) Jun 26, 2014 at 11:22
  • This authentication is for the database? Or there is in some folder insufficient permissions? Jun 26, 2014 at 11:27
  • The authentication is for the URL. What happens when you try curl http://localhost/pycsw/csw.py ? Jun 26, 2014 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.