[OWSLib-users] Post XML in owslib.csw.getrecords2

Joana Simoes joana.simoes at starlab.es
Wed Feb 6 07:07:22 PST 2019


It turns out it was just a problem with the string format.

'''<?xml version="1.0" ?> <csw:GetRecordsmaxRecords="100"
outputFormat="application/xml"
outputSchema="http://www.opengis.net/cat/csw/2.0.2"
resultType="results" service="CSW"version="2.0.2"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:ows="http://www.opengis.net/ows"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-discovery.xsd">
<csw:QuerytypeNames="csw:Record">
<csw:ElementSetName>full</csw:ElementSetName><csw:Constraint
version="1.1.0"> <ogc:Filter> <ogc:PropertyIsLikeescapeChar="\"
singleChar="_" wildCard="%"><ogc:PropertyName>csw:AnyText</ogc:PropertyName><ogc:Literal>Walter/SeaDataNet</ogc:Literal>
</ogc:PropertyIsLike></ogc:Filter> </csw:Constraint> </csw:Query>
</csw:GetRecords>'''


Here is the snippet of code that works (thank you Tom!)

https://gist.github.com/tomkralidis/1582fb0d67941ff3c5c1007c1696e264

By passing the raw xml as unique parameter of getrecords2, I am able to
fire a POST request to GeoNetwork, using owslib.

-- 
Joana Simoes
Technical Lead
Starlab - Living Science

Starlab
Barcelona Offices:
Avinguda Tibidabo 47 bis
08035 Barcelona - Spain
tel: +34 93 254 03 66

e-mail: joana.simoes at starlab.es

Skype: live:joana.simoes_15

website: http://starlab.es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/owslib-users/attachments/20190206/3a8f77d0/attachment.html>


More information about the OWSLib-users mailing list