<div dir="ltr"><div>I have to report a problem but I don't know if this happens because of pyCSW or qgis:</div><div><br></div><div>When I use the MetaSearch plugin, appears my layers from WMS, but when I try to load a layer via WMS call, appears this error:</div><div><br></div><div>

<p style="margin:0px;text-indent:0px;white-space:pre-wrap"><span style="font-size:large;font-weight:600">AttributeError: 'NoneType' object has no attribute 'addRasterLayer' </span></p>
<pre style="margin:12px 0px;text-indent:0px"><span style="font-family:"Courier New"">Traceback (most recent call last):<br>  File "C:/OSGEO4~1/apps/qgis-ltr/./python/plugins\MetaSearch\dialogs\maindialog.py", line 757, in add_to_ows<br>    ows_provider.addRasterLayer.connect(self.iface.addRasterLayer)<br>AttributeError: 'NoneType' object has no attribute 'addRasterLayer'<br></span></pre>
<p style="margin:0px;text-indent:0px;white-space:pre-wrap"><br><span style="font-weight:600">Versión de Python:</span> 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] <br><span style="font-weight:600">Versión de QGIS:</span> 3.10.6-A Coruña A Coruña, ec80021f49 <br></p>
<p style="margin:12px 0px;text-indent:0px;white-space:pre-wrap"><span style="font-size:medium;font-weight:600">Ruta de Python:</span></p>
<ul style="margin:0px"><li style="margin:12px 0px 0px;text-indent:0px;white-space:pre-wrap">C:/OSGEO4~1/apps/qgis-ltr/./python</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:/Users/Brian Luna/AppData/Roaming/QGIS/QGIS3\profiles\default/python</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:/Users/Brian Luna/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:/OSGEO4~1/apps/qgis-ltr/./python/plugins</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGEO4~1\apps\Python37</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGEO4~1\apps\Python37\Scripts</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGeo4W64\bin\python37.zip</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGEO4~1\apps\Python37\DLLs</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGEO4~1\apps\Python37\lib</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGeo4W64\bin</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGEO4~1\apps\Python37\lib\site-packages</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGEO4~1\apps\Python37\lib\site-packages\win32</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGEO4~1\apps\Python37\lib\site-packages\win32\lib</li><li style="margin:0px;text-indent:0px;white-space:pre-wrap">C:\OSGEO4~1\apps\Python37\lib\site-packages\Pythonwin</li><li style="margin:0px 0px 12px;text-indent:0px;white-space:pre-wrap">C:/Users/Brian Luna/AppData/Roaming/QGIS/QGIS3\profiles\default/python</li></ul></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Does anyone know the propertly way to solve it? <br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El jue., 12 nov. 2020 a las 18:25, BRIAN STIFFENN LUNA BOLIVAR (<<a href="mailto:bslunab@correo.udistrital.edu.co">bslunab@correo.udistrital.edu.co</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>
Hi Tom, sorry for the late response, I've been really busy, but I have some really good news: <br></div><div><br></div><div>Last week I applied your recommendation, so I fellow this to configure correctly the harvest:</div><div><br></div><div>1. Change my file post.xml and now look like this:</div><div><br></div><div><?xml version="1.0" encoding="UTF-8"?><br><Harvest xmlns="<a href="http://www.opengis.net/cat/csw/2.0.2" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a>"<br>xmlns:ogc="<a href="http://www.opengis.net/ogc" target="_blank">http://www.opengis.net/ogc</a>"<br>xmlns:gmd="<a href="http://www.isotc211.org/2005/gmd" target="_blank">http://www.isotc211.org/2005/gmd</a>"<br>xmlns:ows="<a href="http://www.opengis.net/ows" target="_blank">http://www.opengis.net/ows</a>"<br>xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>"<br>xmlns:dc="<a href="http://purl.org/dc/elements/1.1/" target="_blank">http://purl.org/dc/elements/1.1/</a>"<br>xmlns:dct="<a href="http://purl.org/dc/terms/" target="_blank">http://purl.org/dc/terms/</a>"<br>xmlns:gml="<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>"<br>xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<br>xsi:schemaLocation="<a href="http://www.opengis.net/cat/csw/2.0.2" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a><br><a href="http://schemas.opengis.net/csw/2.0.2/CSW-publication.xsd" target="_blank">http://schemas.opengis.net/csw/2.0.2/CSW-publication.xsd</a>"<br>service="CSW" version="2.0.2"><br>  <Source><a href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:/ms4w/DATA/geoserviciosgeiper.map" target="_blank">http://127.0.0.1/cgi-bin/mapserv.exe?map=C:/ms4w/DATA/geoserviciosgeiper.map</a></Source><br>  <ResourceType><a href="http://www.opengis.net/wms" target="_blank">http://www.opengis.net/wms</a></ResourceType><br>  <ResourceFormat>application/xml</ResourceFormat><br></Harvest></div><div><br></div><div>(I change 
<a href="http://localhost/." target="_blank">http://localhost/.</a>.. to 
<a href="http://127.0.0.1/" target="_blank">http://127.0.0.1/</a>)</div><div><br></div><div>2. Run the following code: python bin/pycsw-admin.py -c post_xml -u <a href="http://127.0.0.1/pycsw/csw.py" target="_blank">http://127.0.0.1/pycsw/csw.py</a> -x C:/ms4w/DATA/post.xml</div><div><br></div><div>- Harvest works, at the end show: <br></div><div>...</csw:HarvestResponse>' <br></div><div>Done</div><div><br></div><div>3. Then execute the following: pycsw-admin.py -c load_records -p /path/to/records -f default.cfg -y</div><div><br></div><div>4. Prove the csw in QGIS with MetaSearch and here appear my layers, so it works PERFECTLY! Thank you so much for your help.</div><div><br></div><div><u>Now I have a question: Does pyCSW generate an html document with the layers and information in? </u>If not, how can I do this automatically just with the GetCapabilities response?</div><div><br></div><div>Regards,</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié., 14 oct. 2020 a las 5:54, Tom Kralidis (<<a href="mailto:tomkralidis@gmail.com" target="_blank">tomkralidis@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Brian: it looks like the "&" characters in the <Source> element are<br>
causing XML parsing issues.  They are also<br>
not required in the context of a CSW Harvest request.  Can you update<br>
your XML request with just the base URL<br>
in <Source>?  The request parameters are autogenerated by pycsw accordingly:<br>
<br>
<?xml version="1.0" encoding="UTF-8"?><br>
<Harvest xmlns="<a href="http://www.opengis.net/cat/csw/2.0.2" rel="noreferrer" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a>"<br>
xmlns:ogc="<a href="http://www.opengis.net/ogc" rel="noreferrer" target="_blank">http://www.opengis.net/ogc</a>"<br>
xmlns:gmd="<a href="http://www.isotc211.org/2005/gmd" rel="noreferrer" target="_blank">http://www.isotc211.org/2005/gmd</a>"<br>
xmlns:ows="<a href="http://www.opengis.net/ows" rel="noreferrer" target="_blank">http://www.opengis.net/ows</a>"<br>
xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema" rel="noreferrer" target="_blank">http://www.w3.org/2001/XMLSchema</a>"<br>
xmlns:dc="<a href="http://purl.org/dc/elements/1.1/" rel="noreferrer" target="_blank">http://purl.org/dc/elements/1.1/</a>"<br>
xmlns:dct="<a href="http://purl.org/dc/terms/" rel="noreferrer" target="_blank">http://purl.org/dc/terms/</a>"<br>
xmlns:gml="<a href="http://www.opengis.net/gml" rel="noreferrer" target="_blank">http://www.opengis.net/gml</a>"<br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="noreferrer" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
xsi:schemaLocation="<a href="http://www.opengis.net/cat/csw/2.0.2" rel="noreferrer" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a><br>
<a href="http://schemas.opengis.net/csw/2.0.2/CSW-publication.xsd" rel="noreferrer" target="_blank">http://schemas.opengis.net/csw/2.0.2/CSW-publication.xsd</a>"<br>
service="CSW" version="2.0.2"><br>
  <Source><a href="http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/DATA/geoserviciosgeiper.map" rel="noreferrer" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/DATA/geoserviciosgeiper.map</a></Source><br>
  <ResourceType><a href="http://www.opengis.net/wms" rel="noreferrer" target="_blank">http://www.opengis.net/wms</a></ResourceType><br>
  <ResourceFormat>application/xml</ResourceFormat><br>
</Harvest><br>
<br>
Are you able to try again and report back?<br>
<br>
Thanks<br>
<br>
..Tom<br>
<br>
On Tue, Oct 13, 2020 at 10:04 PM BRIAN STIFFENN LUNA BOLIVAR<br>
<<a href="mailto:bslunab@correo.udistrital.edu.co" target="_blank">bslunab@correo.udistrital.edu.co</a>> wrote:<br>
><br>
> Thanks a lot for your response Tom, so I have a question, should I follow this steps to harvest a wms service:<br>
><br>
> 1. Modify the following XML request from my WMS service: <a href="https://github.com/geopython/pycsw/blob/master/tests/functionaltests/suites/harvesting/post/Harvest-wms-run1.xmlv" rel="noreferrer" target="_blank">https://github.com/geopython/pycsw/blob/master/tests/functionaltests/suites/harvesting/post/Harvest-wms-run1.xmlv</a> (I named: post.xml and save it in c:\geiper\post\post.xml)<br>
> 2. Set in my default.cfg transactions=true<br>
> 3. When it's done, I should execute this command line:<br>
><br>
> python bin/pycsw-admin.py -c post_xml -u <a href="http://localhost/pycsw/csw.py" rel="noreferrer" target="_blank">http://localhost/pycsw/csw.py</a> -x c:\geiper\post\post.xml<br>
><br>
> 4. Refresh the harvested records with the following command line:<br>
><br>
> python bin/pycsw-admin.py  -c refresh_harvested_records -f default.cfg<br>
><br>
> Those were all the steps I must follow to harvest records from WMS?<br>
><br>
> If yes, I get the following error:<br>
><br>
> b'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!-- pycsw 2.4.2 -->\n<ows:ExceptionReport xmlns:csw="<a href="http://www.opengis.net/cat/csw/2.0.2" rel="noreferrer" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a>" xmlns:dc="<a href="http://purl.org/dc/elements/1.1/" rel="noreferrer" target="_blank">http://purl.org/dc/elements/1.1/</a>" xmlns:dct="<a href="http://purl.org/dc/terms/" rel="noreferrer" target="_blank">http://purl.org/dc/terms/</a>" xmlns:gmd="<a href="http://www.isotc211.org/2005/gmd" rel="noreferrer" target="_blank">http://www.isotc211.org/2005/gmd</a>" xmlns:gml="<a href="http://www.opengis.net/gml" rel="noreferrer" target="_blank">http://www.opengis.net/gml</a>" xmlns:ows="<a href="http://www.opengis.net/ows" rel="noreferrer" target="_blank">http://www.opengis.net/ows</a>" xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema" rel="noreferrer" target="_blank">http://www.w3.org/2001/XMLSchema</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="noreferrer" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>" version="1.2.0" language="en-US" xsi:schemaLocation="<a href="http://www.opengis.net/ows" rel="noreferrer" target="_blank">http://www.opengis.net/ows</a> <a href="http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd" rel="noreferrer" target="_blank">http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd</a>"><ows:Exception exceptionCode="NoApplicableCode" locator="service"><ows:ExceptionText>Exception: document not well-formed.\nError: EntityRef: expecting \';\', line 3, column 95 (&lt;string&gt;, line 3).</ows:ExceptionText></ows:Exception></ows:ExceptionReport>'<br>
><br>
> And My post.xml is formed like this:<br>
><br>
> <?xml version="1.0" encoding="UTF-8"?><br>
> <Harvest xmlns="<a href="http://www.opengis.net/cat/csw/2.0.2" rel="noreferrer" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a>" xmlns:ogc="<a href="http://www.opengis.net/ogc" rel="noreferrer" target="_blank">http://www.opengis.net/ogc</a>" xmlns:gmd="<a href="http://www.isotc211.org/2005/gmd" rel="noreferrer" target="_blank">http://www.isotc211.org/2005/gmd</a>" xmlns:ows="<a href="http://www.opengis.net/ows" rel="noreferrer" target="_blank">http://www.opengis.net/ows</a>" xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema" rel="noreferrer" target="_blank">http://www.w3.org/2001/XMLSchema</a>" xmlns:dc="<a href="http://purl.org/dc/elements/1.1/" rel="noreferrer" target="_blank">http://purl.org/dc/elements/1.1/</a>" xmlns:dct="<a href="http://purl.org/dc/terms/" rel="noreferrer" target="_blank">http://purl.org/dc/terms/</a>" xmlns:gml="<a href="http://www.opengis.net/gml" rel="noreferrer" target="_blank">http://www.opengis.net/gml</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="noreferrer" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>" xsi:schemaLocation="<a href="http://www.opengis.net/cat/csw/2.0.2" rel="noreferrer" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a> <a href="http://schemas.opengis.net/csw/2.0.2/CSW-publication.xsd" rel="noreferrer" target="_blank">http://schemas.opengis.net/csw/2.0.2/CSW-publication.xsd</a>" service="CSW" version="2.0.2"><br>
><br>
>   <Source><a href="http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/DATA/geoserviciosgeiper.map&SERVICE=WMS&VERSION=1.3.0" rel="noreferrer" target="_blank">http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/DATA/geoserviciosgeiper.map&SERVICE=WMS&VERSION=1.3.0</a></Source><br>
><br>
>   <ResourceType><a href="http://www.opengis.net/wms" rel="noreferrer" target="_blank">http://www.opengis.net/wms</a></ResourceType><br>
>   <ResourceFormat>application/xml</ResourceFormat><br>
> </Harvest><br>
><br>
> Thank you so much for your help.<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> El mar., 13 oct. 2020 a las 19:28, Tom Kralidis (<<a href="mailto:tomkralidis@gmail.com" target="_blank">tomkralidis@gmail.com</a>>) escribió:<br>
>><br>
>> Hi Brian: thanks for the info.  Comments interleaved:<br>
>><br>
>> On Tue, Oct 13, 2020 at 4:13 PM BRIAN STIFFENN LUNA BOLIVAR<br>
>> <<a href="mailto:bslunab@correo.udistrital.edu.co" target="_blank">bslunab@correo.udistrital.edu.co</a>> wrote:<br>
>> ><br>
>> > Hello everyone, good day. I have been trying for over a month to install and run pycsw, but I have not been fortunate enough to do it properly for my college degree work.<br>
>> ><br>
>><br>
>> What kind of installation problems are you having?<br>
>><br>
>> > I currently have a WMS service in place which I need to run Harvest operation and be able to update the GetCapabilities of the CSW however, I have not found the right way to do it.<br>
>> ><br>
>> > Could someone please provide me with a methodological guide to be able to run the Harvest operation to a WMS?<br>
>> ><br>
>><br>
>> You can run a CSW-T Harvest XML POST request with the following XML request:<br>
>><br>
>> <a href="https://github.com/geopython/pycsw/blob/master/tests/functionaltests/suites/harvesting/post/Harvest-wms-run1.xml" rel="noreferrer" target="_blank">https://github.com/geopython/pycsw/blob/master/tests/functionaltests/suites/harvesting/post/Harvest-wms-run1.xml</a><br>
>><br>
>> Here, you would replace the <Source> element content with your WMS<br>
>> base URL.  To invoke XML POST requests, see the following<br>
>> FAQ item: <a href="https://pycsw.org/faq/#how-can-i-make-csw-post-xml-requests" rel="noreferrer" target="_blank">https://pycsw.org/faq/#how-can-i-make-csw-post-xml-requests</a><br>
>><br>
>> Hope this helps.<br>
>><br>
>> ..Tom<br>
>><br>
>> > Q: I'm currently using Mapserver 7.7.0-dev in windows.<br>
>> ><br>
>> > Regards.<br>
>> ><br>
</blockquote></div>
</blockquote></div>