I want to run a WPS process async, I'm sending the following POST request:

------------------------------------------------------------------------------------------------------------


<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
<http://www.w3.org/2001/XMLSchema-instance>" 
xmlns="http://www.opengis.net/wps/1.0.0 <http://www.opengis.net/wps/1.0.0>" 
xmlns:wfs="http://www.opengis.net/wfs <http://www.opengis.net/wfs>" 
xmlns:wps="http://www.opengis.net/wps/1.0.0 <http://www.opengis.net/wps/1.0.0>" 
xmlns:ows="http://www.opengis.net/ows/1.1 <http://www.opengis.net/ows/1.1>" 
xmlns:gml="http://www.opengis.net/gml <http://www.opengis.net/gml>" 
xmlns:ogc="http://www.opengis.net/ogc <http://www.opengis.net/ogc>" 
xmlns:wcs="http://www.opengis.net/wcs/1.1.1 <http://www.opengis.net/wcs/1.1.1>" 
xmlns:xlink="http://www.w3.org/1999/xlink <http://www.w3.org/1999/xlink>" 
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 
<http://www.opengis.net/wps/1.0.0> 
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd 
<http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd>">
  <ows:Identifier>geo:envelope</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>geom</ows:Identifier>
      <wps:Data>
        <wps:ComplexData mimeType="application/json">
            <![CDATA[
        {
  "type": "LineString",
  "coordinates": [
    [
      [
        0,
        0
      ],
      [
        10,
        0
      ],
      [
        10,
        10
      ]
    ]
  ]
}
]]>
        </wps:ComplexData>
      </wps:Data>
    </wps:Input>
  </wps:DataInputs>
  <wps:ResponseForm>
   <wps:ResponseDocument storeExecuteResponse="true" status="true">
    <wps:RawDataOutput mimeType="application/json">
      <ows:Identifier>result</ows:Identifier>
    </wps:RawDataOutput>
   </wps:ResponseDocument>
  </wps:ResponseForm>
</wps:Execute>

--------------------------------------------------------------------------------------------------------------------------------

Then I got the following response:
--------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?><wps:ExecuteResponse 
xmlns:xs="http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema>" 
xmlns:ows="http://www.opengis.net/ows/1.1 <http://www.opengis.net/ows/1.1>" 
xmlns:wps="http://www.opengis.net/wps/1.0.0 <http://www.opengis.net/wps/1.0.0>" 
xmlns:xlink="http://www.w3.org/1999/xlink <http://www.w3.org/1999/xlink>" 
xml:lang="en" service="WPS" 
serviceInstance="http://localhost:6256/geoserver/ows 
<http://localhost:6256/geoserver/ows>?" 
statusLocation="http://localhost:6256/geoserver/ows?service=WPS&amp;version=1.0.0&amp;request=GetExecutionStatus&amp;executionId=a07966f1-0b19-4070-bea3-2ce78ca487da
 
<http://localhost:6256/geoserver/ows?service=WPS&version=1.0.0&request=GetExecutionStatus&executionId=a07966f1-0b19-4070-bea3-2ce78ca487da>"
 version="1.0.0">    <wps:Process wps:processVersion="1.0.0">        
<ows:Identifier>            geo:envelope        </ows:Identifier>        
<ows:Title>            Envelope        </ows:Title>        <ows:Abstract>       
     Returns the smallest bounding box polygon that contains a geometry. For a 
point geometry, returns the same point.        </ows:Abstract>    
</wps:Process>    <wps:Status creationTime="2018-04-11T15:09:20.938Z">        
<wps:ProcessAccepted>            Process accepted.        
</wps:ProcessAccepted>    </wps:Status></wps:ExecuteResponse>
--------------------------------------------------------------------------------------------------------------------------------

Then I send the following GET  request:
----------------------------------------------------------------------------------------------------
http://localhost:6256/geoserver/ows?service=WPS&version=1.0.0&request=GetExecutionStatus&executionId=a07966f1-0b19-4070-bea3-2ce78ca487da
 
<http://localhost:6256/geoserver/ows?service=WPS&version=1.0.0&request=GetExecutionStatus&executionId=a07966f1-0b19-4070-bea3-2ce78ca487da>
--------------------------------------------------------------------------------------------------------------------------------

Then I got the following response:
--------------------------------------------------------------------------------------------------------------------------------
<wps:ExecuteResponse xml:lang="en" service="WPS" 
serviceInstance="http://localhost:6256/geoserver/ows 
<http://localhost:6256/geoserver/ows>?" 
statusLocation="http://localhost:6256/geoserver/ows?service=WPS&version=1.0.0&request=GetExecutionStatus&executionId=a07966f1-0b19-4070-bea3-2ce78ca487da
 
<http://localhost:6256/geoserver/ows?service=WPS&version=1.0.0&request=GetExecutionStatus&executionId=a07966f1-0b19-4070-bea3-2ce78ca487da>"
 version="1.0.0">
    <wps:Process wps:processVersion="1.0.0">
        <ows:Identifier>geo:envelope</ows:Identifier>
        <ows:Title>Envelope</ows:Title>
        <ows:Abstract>Returns the smallest bounding box polygon that contains a 
geometry. For a point geometry, returns the same point.</ows:Abstract>
    </wps:Process>
    <wps:Status creationTime="2018-04-11T15:09:20.938Z">
        <wps:ProcessSucceeded>Process succeeded.</wps:ProcessSucceeded>
    </wps:Status>
    <wps:ProcessOutputs>
        <wps:Output>
            <ows:Identifier>result</ows:Identifier>
            <ows:Title>Envelope of the input geometry</ows:Title>
            <wps:Data>
                <wps:ComplexData mimeType="text/xml; subtype=gml/3.1.1">
                    <gml:Polygon srsDimension="2">
                        <gml:exterior>
                            <gml:LinearRing srsDimension="2">
                                <gml:posList>0 0 0 10 10 10 10 0 0 
0</gml:posList>
                            </gml:LinearRing>
                        </gml:exterior>
                    </gml:Polygon>
                </wps:ComplexData>
            </wps:Data>
        </wps:Output>
    </wps:ProcessOutputs>
</wps:ExecuteResponse>
--------------------------------------------------------------------------------------------------------------------------------

The problem is that the geometry data is returned as GML, although in my 1st 
request I set the output mime-type to "application/json". 
If I run the same request synchronously, I got a json response correctly. 
What am I doing wrong?
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to