geopython / pywps-flask

Demo service for PyWPS 4 with Flask
MIT License
21 stars 31 forks source link

XML parser for Docker container #42

Closed lazaa32 closed 5 years ago

lazaa32 commented 6 years ago

Description

I have a problem with xml parsing when using alpine/flask Dockerfile (the only minor change is upgraded Xerces version to 3.2.1 and added curl package to apk). After building and starting a container I tried to send sample POST request using curl from within the running container but I got ExceptionError:Start tag expected, '<' not found, line 1, column 1</ows:ExceptionText>

Environment

Docker alpine/flask

Steps to Reproduce

Check if Xerces version in alpine/flask Docker file is updated to 3.2.1. Add curl to apk packages. Then:


docker build -t flask .
docker run -it  flask
docker exec -it $(docker ps -aq) /bin/bash
curl -d pywps-flask/static/requests/execute_buffer_post.xml localhost:5000/wps

Additional Information

I also tried to use OWSLib to send the request and I get the result code but the output in response is not well-formated:

        <wps:Output>
            <ows:Identifier>buff_out</ows:Identifier>
            <ows:Title>Buffered file</ows:Title>
            <ows:Abstract></ows:Abstract>
            <wps:Data>
                <wps:ComplexData mimeType="application/gml+xml" encoding="" schema="">
                    <![CDATA[
                            &lt;ogr:FeatureCollection xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34; xmlns:ogr=&#34;http://ogr.maptools.org/&#34; xmlns:gml=&#34;http://www.opengis.net/gml&#34; xsi:schemaLocation=&#34;                            http://schemas.opengis.net/gml/2.1.2/feature.xsd&#34;&gt;
  &lt;gml:boundedBy&gt;
    &lt;gml:Box&gt;
      &lt;gml:coord&gt;&lt;gml:X&gt;-0.9514645979959721&lt;/gml:X&gt;&lt;gml:Y&gt;-0.986306232731747&lt;/gml:Y&gt;&lt;/gml:coord&gt;
      &lt;gml:coord&gt;&lt;gml:X&gt;1.048535402004028&lt;/gml:X&gt;&lt;gml:Y&gt;1.013693767268253&lt;/gml:Y&gt;&lt;/gml:coord&gt;
    &lt;/gml:Box&gt;
  &lt;/gml:boundedBy&gt;

  &lt;gml:featureMember&gt;
    &lt;ogr:point_buffer fid=&#34;point_buffer.0&#34;&gt;
      &lt;ogr:geometryProperty&gt;&lt;gml:Polygon&gt;&lt;gml:outerBoundaryIs&gt;&lt;gml:LinearRing&gt;&lt;gml:coordinates&gt;1.04853540200403,0.013693767268253 1.0471649367586,-0.038642188974691 1.0430572973723,-0.0908346959994 11.03622374259917,0.170128232308481 1.0430572973723,0.118222230535904 1.0471649367586,0.066029723511194 1.04853540200403,0.013693767268253&lt;/gml:coordinates&gt;&lt;/gml:LinearRing&gt;&lt;/gml:outerBoundaryIs&gt;&lt;/gml:Polygon&gt;&lt;/ogr:geometryProperty&gt;
    &lt;/ogr:point_buffer&gt;
  &lt;/gml:featureMember&gt;
&lt;/ogr:FeatureCollection&gt;

                    ]]>
                </wps:ComplexData>
            </wps:Data>
        </wps:Output>
lazaa32 commented 5 years ago

Fixed by updating to current pywps version.