0

I get input of WPS execute service from WFS Getfeature service by using wps:Reference tag in my test request. Due to testing of the request, the validation mode of the process has been set to NONE. I examined two following requests. The first request refers to external WFS request while WFS request is embedded in the second WPS request. The first request returns 'Hello' (works) but the second do not returns anything. Is it possible that WFS request is included in WPS request? Can anybody help me to understand my mistake?


I use PyWPS version 4.3.dev0 and Ubuntu 18.04.

First request:

<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute 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" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             service="WPS" 
             version="1.0.0" 
             xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsExecute_request.xsd">
   <ows:Identifier>demobuffer</ows:Identifier>
   <wps:DataInputs>
      <wps:Input>
         <ows:Identifier>vector</ows:Identifier>
         <ows:Title>Vector map</ows:Title>
         <wps:Reference xlink:href="http://foo.bar/some_WFS_request.xml" />
      </wps:Input>
   </wps:DataInputs>
   <wps:ResponseForm>
      <wps:RawDataOutput>
         <ows:Identifier>response</ows:Identifier>
      </wps:RawDataOutput>
   </wps:ResponseForm>
</wps:Execute>

Second request:

<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute 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" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             service="WPS" version="1.0.0" 
             xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsExecute_request.xsd">
   <ows:Identifier>demobuffer</ows:Identifier>
   <wps:DataInputs>
      <wps:Input>
         <ows:Identifier>vector</ows:Identifier>
         <ows:Title>Vector map</ows:Title>
         <wps:Reference encoding="UTF-8" method="POST" mimeType="text/xml" xlink:href="https://ahocevar.com/geoserver/wfs">
            <wps:Body>
               <GetFeature xmlns="http://www.opengis.net/wfs" service="WFS" version="1.1.0" outputFormat="application/json" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
                  <Query xmlns:osm="http://openstreemap.org" typeName="osm:water_areas" srsName="EPSG:3857">
                     <Filter xmlns="http://www.opengis.net/ogc">
                        <And>
                           <PropertyIsLike wildCard="*" singleChar="." escapeChar="!">
                              <PropertyName>name</PropertyName>
                              <Literal>Mississippi*</Literal>
                           </PropertyIsLike>
                           <PropertyIsEqualTo>
                              <PropertyName>waterway</PropertyName>
                              <Literal>riverbank</Literal>
                           </PropertyIsEqualTo>
                        </And>
                     </Filter>
                  </Query>
               </GetFeature>
            </wps:Body>
         </wps:Reference>
      </wps:Input>
   </wps:DataInputs>
   <wps:ResponseForm>
      <wps:RawDataOutput>
         <ows:Identifier>response</ows:Identifier>
      </wps:RawDataOutput>
   </wps:ResponseForm>
</wps:Execute>

process:

class DemoBuffer(Process):
def __init__(self):
    inputs = [ComplexInput('vector','Vector map', supported_formats=[Format('application/geojson')],mode=MODE.NONE)]
    outputs = [LiteralOutput('response','Output response', data_type='string')]

    super(DemoBuffer, self).__init__(
        self._handler,
        identifier='demobuffer',
        title='Buffer',
        abstract='This process demonstrates, how to create any process in PyWPS environment',
        metadata=[Metadata('process metadata 1', 'http://example.org/1'),
                  Metadata('process metadata 2', 'http://example.org/2')],
        version='1.0.0',
        inputs=inputs,
        outputs=outputs,
        store_supported=True,
        status_supported=True
    )

def _handler(self, request, response):
    response.outputs['response'].data = 'Hello'
    response.outputs['response'].uom = UOM('unity')
    return response

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.