Hello everyone,
I'm investigating about a difference between geoserver and deegree WPS.
according to OGC WPS IS
"If storage of a ComplexData output has not been requested via the
―asReference
attribute (see Table 51), the ExecuteResponse document will contain that
output. For
ComplexData such as images included in the ExecuteResponse document will be
encoded."
I created a GeoServer WPS (something like the following snippet)
....
@DescribeResults({
@DescribeResult(name = "aFile", description="jpeg file", type =
RenderedImage.class),
@DescribeResult(name = "message", description="a message", type =
String.class)})
public Map<String, Object> execute(
@DescribeParameter(name = "value", description = "a generic string
value") String value) {
Map<String, Object> results = new HashMap<String, Object>();
try {
RenderedImage aFile = ImageIO.read(new File("/tmp/image.jpeg"));
results.put("aFile", aFile);
} catch (Exception ex) {
results.put("message", "bla bla bla");
}
return results;
}
....
Launching the process on GeoServer via WPS Request Builder (.war from trunk
17259 deployed on glassfish 3.1.2.2 CentOS5.5)
<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns="
http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs"
xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="
http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="
http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
<ows:Identifier>gs:Test</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>value</ows:Identifier>
<wps:Data>
<wps:LiteralData>aslkdfhals</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:ResponseDocument>
<wps:Output mimeType="image/jpeg">
<ows:Identifier>aFile</ows:Identifier>
</wps:Output>
</wps:ResponseDocument>
</wps:ResponseForm>
</wps:Execute>
the result is
<?xml version="1.0" encoding="UTF-8"?>
<wps:ExecuteResponse xml:lang="en" service="WPS" serviceInstance="
http://xyz:8080/geoserver/ows?" version="1.0.0" xmlns: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">
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>gs:TestFEP</ows:Identifier>
<ows:Title>testFEP</ows:Title>
<ows:Abstract>test FEP</ows:Abstract>
</wps:Process>
<wps:Status creationTime="2012-09-18T12:56:04.977Z">
<wps:ProcessSucceeded>Process succeeded.</wps:ProcessSucceeded>
</wps:Status>
<wps:ProcessOutputs>
<wps:Output>
<ows:Identifier>bFile</ows:Identifier>
<ows:Title>jpeg file</ows:Title>
<wps:Data>
<wps:ComplexData mimeType="image/jpeg"/>
</wps:Data>
</wps:Output>
</wps:ProcessOutputs>
</wps:ExecuteResponse>
As you see, there is no in line data in the complex. A similar service on
deegree returns inline data (following an xml snippet)
....
<wps:Output>
<ows:Identifier>BinaryOutput</ows:Identifier>
<ows:Title>A binary output parameter</ows:Title>
<wps:Data>
<wps:ComplexData mimeType="image/png"
encoding="base64">iVBORw0KGgoAAAANSUhEUgAAAM...........5CYII=</wps:ComplexData>
</wps:Data>
</wps:Output>
....
Looking for a reason in wps-core I found the method
ExecuteProcessResponse.write(...), it seems that when the response is not a
raw one the writeComplex method is never called so BinaryEncoderDelegate
has no chance to deliver Jpeg content
Probably I'm missing some clue so any advice is welcome
TIA,
Fabrizio
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users