[Pywps-dev] Sending GML as data input

Jachym Cepicky jachym.cepicky at gmail.com
Wed Jul 6 04:30:00 PDT 2016


hi,

we moved from single-input model to collection model - that practically
means, that instead of

doc = lxml.etree.parse(request.inputs['layer'].file)

you should use

doc = lxml.etree.parse(request.inputs['layer'][0].file)

Hint: use "protocol://url" input form, e.g. in your case layer=
http://localhost/wps/point.gml

hope, it helped

J

po 4. 7. 2016 v 16:49 odesílatel Marcel Wolters - Periplus Group <
m.wolters at periplus.nl> napsal:

> Hi list,
>
>
>
> I set up PyWPS-4 and the pywps-demo on an Ubuntu 16.04 server.
>
> But I can’t figure out how to send a GML as input.
>
>
>
> 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
>
>
> http://localhost:5001/wps?service=wps&version=1.0.0&request=execute&identifier=feature_count&datainputs=layer=localhost/wps/point.gml
>
>
>
> The server gives this error message:
>
> <type 'collections.deque'>
>
> Traceback (most recent call last):
>
>   File "/home/marcel/src/pywps/pywps/app/Process.py", line 233, in
> _run_process
>
>     wps_response = self.handler(wps_request, wps_response)
>
>   File "/home/marcel/pywps-demo/processes/feature_count.py", line 27, in
> _handler
>
>     doc = lxml.etree.parse(request.inputs['layer'].file)
>
> AttributeError: 'collections.deque' object has no attribute 'file'
>
> ERROR:pywps.app.Process:Process error: feature_count.py._handler Line 27
> 'collections.deque' object has no attribute 'file'
>
> ERROR:pywps.exceptions:Exception: code: 400, locator: Service error: near
> "collections": syntax error, description:
>
> Traceback (most recent call last):
>
>   File "/home/marcel/src/pywps/pywps/app/Service.py", line 365, in
> _parse_and_execute
>
>     wps_response = process.execute(wps_request, uuid)
>
>   File "/home/marcel/src/pywps/pywps/app/Process.py", line 159, in execute
>
>     wps_response = self._execute_process(async, wps_request, wps_response)
>
>   File "/home/marcel/src/pywps/pywps/app/Process.py", line 203, in
> _execute_process
>
>     wps_response = self._run_process(wps_request, wps_response)
>
>   File "/home/marcel/src/pywps/pywps/app/Process.py", line 266, in
> _run_process
>
>     wps_response.update_status(msg, -1)
>
>   File "/home/marcel/src/pywps/pywps/app/WPSResponse.py", line 56, in
> update_status
>
>     update_response(self.uuid, self)
>
>   File "/home/marcel/src/pywps/pywps/dblog.py", line 113, in
> update_response
>
>     cur.execute(update)
>
> OperationalError: near "collections": syntax error
>
>
>
>
>
> When I try to send the GML using the HTTP POST method, the server gives
> this message:
>
> ERROR:pywps.exceptions:Exception: code: 400, locator: Start tag expected,
> '<' not found, line 1, column 1, description:
>
> Traceback (most recent call last):
>
>   File "/home/marcel/src/pywps/pywps/app/WPSRequest.py", line 80, in
> _post_request
>
>     doc = lxml.etree.fromstring(self.http_request.get_data())
>
>   File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring
> (src/lxml/lxml.etree.c:77697)
>
>   File "src/lxml/parser.pxi", line 1819, in
> lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:116494)
>
>   File "src/lxml/parser.pxi", line 1707, in lxml.etree._parseDoc
> (src/lxml/lxml.etree.c:115144)
>
>   File "src/lxml/parser.pxi", line 1079, in
> lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:109543)
>
>   File "src/lxml/parser.pxi", line 573, in
> lxml.etree._ParserContext._handleParseResultDoc
> (src/lxml/lxml.etree.c:103404)
>
>   File "src/lxml/parser.pxi", line 683, in lxml.etree._handleParseResult
> (src/lxml/lxml.etree.c:105058)
>
>   File "src/lxml/parser.pxi", line 613, in lxml.etree._raiseParseError
> (src/lxml/lxml.etree.c:103967)
>
> XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1
>
>
>
> So, what am I doing wrong?
>
>
>
>
>
>
>
> With kind regards,
>
> Marcel Wolters
>
>
> _______________________________________________
> pywps-dev mailing list
> pywps-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pywps-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pywps-dev/attachments/20160706/9c1a255a/attachment.html>


More information about the pywps-dev mailing list