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

OWSLib can't open the CWIC CSW #76

Closed
rsignell-usgs opened this issue Aug 23, 2013 · 11 comments
Closed

OWSLib can't open the CWIC CSW #76

rsignell-usgs opened this issue Aug 23, 2013 · 11 comments

Comments

@rsignell-usgs
Copy link
Contributor

When I try to open NASA's CWIC CSW endpoint:
http://cwic.csiss.gmu.edu/cwicv1/discovery
listed at on the CEOS CWIC page, I get an error:

endpoint = 'http://cwic.csiss.gmu.edu/cwicv1/discovery'  # CWIC
csw = CatalogueServiceWeb(endpoint,timeout=60)

ExceptionReport: 'REQUEST_EXCEPTION: UNRECOGNIZED_REQUEST - Only GetRecords and GetRecordById supported for HTTP POST method.'

I'm guessing this isn't really an OWSlib issue, but more a provider issue, right?
Can you tell what the CWIC folks would need to fix to have OWSlib work with this CSW?

Thanks,
Rich

@tomkralidis
Copy link
Member

@rsignell-usgs the CWIC CSW will have to support HTTP POST for GetCapabilities, not just HTTP GET.

@rsignell-usgs
Copy link
Contributor Author

Okay, thanks, I'll tell them.

@tomkralidis
Copy link
Member

@rsignell-usgs turns out for GetCapabilities, HTTP POST is optional, and HTTP GET is mandatory to support. So the CWIC CSW is doing things right. So owslib.csw.CatalogueServiceWeb() needs to be updated to send the GetCapabilities request as HTTP GET.

@tomkralidis tomkralidis reopened this Aug 23, 2013
@tomkralidis
Copy link
Member

@rsignell-usgs
Copy link
Contributor Author

Great! That will be a nice enhancement for OWSLib. We certainly can't count on optional functionality!

@rsignell-usgs
Copy link
Contributor Author

How big a job is this?

tomkralidis added a commit to tomkralidis/OWSLib that referenced this issue Aug 23, 2013
@tomkralidis
Copy link
Member

@rsignell-usgs See branch at https://github.com/tomkralidis/OWSLib/tree/issue-76. I tried it and it works for me (although there are GetRecords which are not related -- another investigation). Does this work for you for GetCapabilities?

@rsignell-usgs
Copy link
Contributor Author

Yes, this fixed the GetCapabilities issue! (but as I suspect you are, I'm now getting a 500 server error when I try to get records)

tomkralidis added a commit that referenced this issue Aug 24, 2013
CSW GetCapabilities should be HTTP GET (#76)
@capooti
Copy link

capooti commented Mar 17, 2014

Hi @tomkralidis
not sure if it is a related issue and before I open another issue: using this catalog, where POST in getrecords seems to be supported, I get the following error in getrecords:

from owslib.csw import CatalogueServiceWeb
csw = CatalogueServiceWeb('http://www.rndt.gov.it/RNDT/CSW?')
csw.getrecords(keywords=['test'], maxrecords=20)
UserWarning: Please use the updated 'getrecords2' method instead of 'getrecords'.
The 'getrecords' method will be upgraded to use the 'getrecords2' parameters
in a future version of OWSLib.
in a future version of OWSLib.""")
TypeError: int() argument must be a string or a number, not 'NoneType'

any idea? thanks

@tomkralidis
Copy link
Member

@capooti thanks for the info. My trace:


>>> c=s('http://www.rndt.gov.it/RNDT/CSW?')
>>> c.getrecords(keywords=['test'], maxrecords=20)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "owslib/csw.py", line 236, in getrecords
    self.results['matches'] = int(util.testXMLValue(val, True))
TypeError: int() argument must be a string or a number, not 'NoneType'
>>> print c.response
<?xml version="1.0" encoding="utf-8"?>
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">
<csw:RequestId xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
<csw:SearchStatus />
<csw:SearchResults elementSet="summary" recordSchema="csw:Record" />
</csw:GetRecordsResponse>

. This is not a valid CSW endpoint. CSW 2.0.2 requires the numberOfRecordsReturned and numberOfRecordsMatched attributes within the csw:SearchResults element as part of GetRecords responses.

@capooti
Copy link

capooti commented Mar 18, 2014

You are right, it was a problem of their implementation, now they have fixed. Thanks

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

No branches or pull requests

3 participants