<div dir="ltr">hi,<div><br></div><div>we moved from single-input model to collection model - that practically means, that instead of </div><div><br></div><div>doc = lxml.etree.parse(request.inputs['layer'].file)<br></div><div><br></div><div>you should use</div><div><br></div><div>doc = lxml.etree.parse(request.inputs['layer'][0].file)<br></div><div><br></div><div>Hint: use "protocol://url" input form, e.g. in your case layer=<a href="http://localhost/wps/point.gml">http://localhost/wps/point.gml</a></div><div><br></div><div>hope, it helped</div><div><br></div><div>J</div></div><br><div class="gmail_quote"><div dir="ltr">po 4. 7. 2016 v 16:49 odesílatel Marcel Wolters - Periplus Group <<a href="mailto:m.wolters@periplus.nl">m.wolters@periplus.nl</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="NL" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal">Hi list,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="EN-GB">I set up PyWPS-4 and the pywps-demo on an Ubuntu 16.04 server.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">But I can’t figure out how to send a GML as input.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">When I send the url to the GML file as parameter in the WPS request when calling the feature_count demo process (or the centroids demo process), like this<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-family:"Courier New";color:#595959"><a href="http://localhost:5001/wps?service=wps&version=1.0.0&request=execute&identifier=feature_count&datainputs=layer=localhost/wps/point.gml" target="_blank">http://localhost:5001/wps?service=wps&version=1.0.0&request=execute&identifier=feature_count&datainputs=layer=localhost/wps/point.gml</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The server gives this error message:<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959"><type 'collections.deque'><u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">Traceback (most recent call last):<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">  File "/home/marcel/src/pywps/pywps/app/Process.py", line 233, in _run_process<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">    wps_response = self.handler(wps_request, wps_response)<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">  File "/home/marcel/pywps-demo/processes/feature_count.py", line 27, in _handler<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">    doc = lxml.etree.parse(request.inputs['layer'].file)<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">AttributeError: 'collections.deque' object has no attribute 'file'<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">ERROR:pywps.app.Process:Process error: feature_count.py._handler Line 27 'collections.deque' object has no attribute 'file'<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">ERROR:pywps.exceptions:Exception: code: 400, locator: Service error: near "collections": syntax error, description:<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">Traceback (most recent call last):<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">  File "/home/marcel/src/pywps/pywps/app/Service.py", line 365, in _parse_and_execute<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">    wps_response = process.execute(wps_request, uuid)<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">  File "/home/marcel/src/pywps/pywps/app/Process.py", line 159, in execute<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">    wps_response = self._execute_process(async, wps_request, wps_response)<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">  File "/home/marcel/src/pywps/pywps/app/Process.py", line 203, in _execute_process<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">    wps_response = self._run_process(wps_request, wps_response)<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">  File "/home/marcel/src/pywps/pywps/app/Process.py", line 266, in _run_process<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">    wps_response.update_status(msg, -1)<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">  File "/home/marcel/src/pywps/pywps/app/WPSResponse.py", line 56, in update_status<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">    update_response(self.uuid, self)<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">  File "/home/marcel/src/pywps/pywps/dblog.py", line 113, in update_response<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">    cur.execute(update)<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">OperationalError: near "collections": syntax error</span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">When I try to send the GML using the HTTP POST method, the server gives this message:<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">ERROR:pywps.exceptions:Exception: code: 400, locator: Start tag expected, '<' not found, line 1, column 1, description:<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">Traceback (most recent call last):<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">  File "/home/marcel/src/pywps/pywps/app/WPSRequest.py", line 80, in _post_request<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">   
</span><span lang="DE" style="color:#595959">doc = lxml.etree.fromstring(self.http_request.get_data())<u></u><u></u></span></p>
<p><span lang="DE" style="color:#595959">  File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:77697)<u></u><u></u></span></p>
<p><span lang="DE" style="color:#595959">  File "src/lxml/parser.pxi", line 1819, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:116494)<u></u><u></u></span></p>
<p><span lang="DE" style="color:#595959">  File "src/lxml/parser.pxi", line 1707, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:115144)<u></u><u></u></span></p>
<p><span lang="DE" style="color:#595959">  File "src/lxml/parser.pxi", line 1079, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:109543)<u></u><u></u></span></p>
<p><span lang="DE" style="color:#595959">  File "src/lxml/parser.pxi", line 573, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:103404)<u></u><u></u></span></p>
<p><span lang="DE" style="color:#595959">  File "src/lxml/parser.pxi", line 683, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:105058)<u></u><u></u></span></p>
<p><span lang="DE" style="color:#595959">  File "src/lxml/parser.pxi", line 613, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:103967)<u></u><u></u></span></p>
<p><span lang="EN-GB" style="color:#595959">XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">So, what am I doing wrong?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span>With kind regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span>Marcel Wolters<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
</div>
</div>

_______________________________________________<br>
pywps-dev mailing list<br>
<a href="mailto:pywps-dev@lists.osgeo.org" target="_blank">pywps-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pywps-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pywps-dev</a></blockquote></div>