Folowing up on my previous post:
It turns out that the service always successfully gives 'Error' when
returning a python dict object.
Here's how to reproduce:
===========================
from geoserver.wps import process
@process(
title='Test WPS',
description='None..',
inputs={
'name': (str,'Name of process')
},
outputs={
'name': (str,'Name of process')
#,'bogus':(str,'Bogus output')
}
)
def run(name):
return {'name':name} # succeeds but actually returns 'Error'
#return name #succeeds
#return {'name':name,'bogus':'Hello world'} # fails: Process failed
during execution java.lang.IllegalStateException: Process returned 1
values, should have returned 2 Process returned 1 values, should have
returned 2
#return name, 'Hello world' #fails: Process failed during execution
java.lang.ClassCastException: java.lang.String cannot be cast to
org.python.core.PyObject java.lang.String cannot be cast to
org.python.core.PyObject
==============
Result of return {'name':name} :
<wps:ExecuteResponsexmlns:wps="http://www.opengis.net/wps/1.0.0"xmlns:ows="http://www.opengis.net/ows/1.1"xmlns:xlink="http://www.w3.org/1999/xlink"xml:lang="en"service="WPS"serviceInstance="http://localhost/geoserver/ows?"version="1.0.0">
<wps:Processwps:processVersion="1.0.0">
<ows:Identifier>py:test</ows:Identifier>
<ows:Title>Test WPS</ows:Title>
<ows:Abstract>None..</ows:Abstract>
</wps:Process>
<wps:StatuscreationTime="2013-04-19T08:56:25.508Z">
<wps:ProcessSucceeded>Process succeeded.</wps:ProcessSucceeded>
</wps:Status>
<wps:ProcessOutputs>
<wps:Output>
<ows:Identifier>name</ows:Identifier>
<ows:Title>Name of process</ows:Title>
<wps:Data>
<wps:LiteralData>Error</wps:LiteralData>
</wps:Data>
</wps:Output>
</wps:ProcessOutputs>
</wps:ExecuteResponse>
On 17-4-2013 13:51, Tom van Tilburg wrote:
Hi all,
I'm working on a python WPS script in geoserver. Therefore I use the
following manual:
ref:
http://docs.geoserver.org/latest/en/user/community/scripting/py/index.html
According to the manual I return my values like:
return {
'mykey1':myvalue1,
'mykey2':myvalye2,
'mykey3':myvalye3
}
However, this is the error I get:
ERROR [geoserver.wps] - Process execution failed
org.geotools.process.ProcessException:
java.lang.IllegalStateException: Process returned 1 values, should
have returned 3
Aside from that, there is a warn on the Responsedocument:
WARN [geoserver.wps] - cvc-complex-type.2.4.b: The content of
element 'wps:ResponseDocument' is not complete. One of
'{"http://www.opengis.net/wps/1.0.0":Output}' is expected.
Using only 1 output value it works correctly.
Does anyone have a clue?
Regards,
Tom
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users