<html><body><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;">Hi Sylvain, </div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;"><br data-mce-bogus="1"></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;">if you have only one output, you can use the rawdataoutput paramater, just like this WPS request: </div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;"><br data-mce-bogus="1"></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;">http://artemis.geogr.uni-jena.de/cgi-bin/testbox.cgi?service=WPS&version=1.0.0&request=Execute&identifier=fossgis_wps_proj&datainputs=[epsg_target=2927;epsg_source=4326;wkt=POINT(11%2051)]<strong>&rawdataoutput=output</strong><br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;"><br data-mce-bogus="1"></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;">In your case it should be &rawdataoutput=out. Then you will get directly the data from this output. </div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;"><br data-mce-bogus="1"></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;">Cheers,</div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;">Jonas</div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000;"><br><span id="zwchr" data-marker="__DIVIDER__">----- Am 23. Okt 2016 um 19:17 schrieb Sylvain Beorchia <sylvain.beorchia@gmail.com>:<br></span><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr">Thank you for the fix Jachym.<br><div>But apparently it just changes the output, from :</div><br><div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;">...</div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;"><span style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;"><wps:ComplexData mimeType="application/geojson"</span><span style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;">></span><br></div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;"><![CDATA[</div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;">WwogICJmb28iLCAKICB7CiAgICAiYmFyIjogWwogICAgICAiYmF6IiwgCiAgICAgIG51bGwsIAogICAgICAxLjAsIAogICAgICAyCiAgICBdCiAgfQpd</div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;">]]></div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;"></wps:ComplexData></div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;"><br></div></div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;">to:</div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;"><br></div><div style="font-size: 12.8px;" data-mce-style="font-size: 12.8px;"><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag"><wps:ComplexData<span class="gmail-html-attribute"> <span class="gmail-html-attribute-name">mimeType</span>="<span class="gmail-html-attribute-value">application/geojson</span>"</span>></span></div><div class="gmail-collapsible-content" style="margin-left: 1em; color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="margin-left: 1em; color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-text">[ "foo", { "bar": [ "baz", null, 1.0, 2 ] } ]</span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag"></wps:ComplexData></span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag"><br></span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag"><br></span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag">JSON, but still in XML result.</span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag">Am i doing something wrong in my code ?</span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag"><br></span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag"><br></span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag">Thanks .</span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag"><br></span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag">Sylvain.</span></div><div class="gmail-line" style="color: #000000; font-family: monospace; font-size: 13px;" data-mce-style="color: #000000; font-family: monospace; font-size: 13px;"><span class="gmail-html-tag"><br></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-10-23 8:01 GMT+02:00 Jachym Cepicky <span dir="ltr"><<a href="mailto:jachym.cepicky@gmail.com" target="_blank">jachym.cepicky@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div dir="ltr">Hi Sylvain,<br><div>fixed in master <a href="https://github.com/geopython/pywps/pull/201" target="_blank">https://github.com/geopython/pywps/pull/201</a></div><br><div>Hope, it works</div><br><div>J</div><br><br><br><div class="gmail_quote"><div dir="ltr">so 22. 10. 2016 v 23:42 odesílatel Sylvain Beorchia <<a href="mailto:sylvain.beorchia@gmail.com" target="_blank">sylvain.beorchia@gmail.com</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div><div class="h5"><div dir="ltr" class="m_6344686693849570342gmail_msg">Hi all,<div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg">Trying to build my first WPS, i want to return JSON outputs. After many tests, i always got some JSON encoded chars embeded in XML, or clear JSON embeded in XML...always XML. </div><div class="m_6344686693849570342gmail_msg">Here is the simple code i've tried :</div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg"><div class="m_6344686693849570342gmail_msg">import json</div><div class="m_6344686693849570342gmail_msg">from pywps import Process, LiteralInput, LiteralOutput, OGCUNIT, UOM, ComplexInput, ComplexOutput, Format, FORMATS</div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg">class Test(Process):</div><div class="m_6344686693849570342gmail_msg">    def __init__(self):</div><div class="m_6344686693849570342gmail_msg">        inputs = [LiteralInput('name', 'Input name', data_type='string')]</div><div class="m_6344686693849570342gmail_msg">        outputs = [ComplexOutput('out', 'Referenced Output', supported_formats=[Format('application/geojson')])]</div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg">        super(Test, self).__init__(</div><div class="m_6344686693849570342gmail_msg">            self._handler,</div><div class="m_6344686693849570342gmail_msg">            identifier='cartogsm',</div><div class="m_6344686693849570342gmail_msg">            title='Process Test',</div><div class="m_6344686693849570342gmail_msg">            version='1.0.0.0',</div><div class="m_6344686693849570342gmail_msg">            inputs=inputs,</div><div class="m_6344686693849570342gmail_msg">            outputs=outputs,</div><div class="m_6344686693849570342gmail_msg">            store_supported=True,</div><div class="m_6344686693849570342gmail_msg">            status_supported=True</div><div class="m_6344686693849570342gmail_msg">        )</div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg">    def _handler(self, request, response):</div><div class="m_6344686693849570342gmail_msg">        data = json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')</div><div class="m_6344686693849570342gmail_msg">        out_bytes = json.dumps(data, indent=2)</div><div class="m_6344686693849570342gmail_msg">        response.outputs['out'].output_format = 'application/json'</div><div class="m_6344686693849570342gmail_msg">        response.outputs['out'].data = out_bytes</div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg">        return response</div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg">Ouput :</div><div class="m_6344686693849570342gmail_msg">...</div><div class="m_6344686693849570342gmail_msg"><wps:ProcessOutputs></div><div class="m_6344686693849570342gmail_msg"><wps:Output></div><div class="m_6344686693849570342gmail_msg"><ows:Identifier>out</ows:Identifier></div><div class="m_6344686693849570342gmail_msg"><ows:Title>Referenced Output</ows:Title></div><div class="m_6344686693849570342gmail_msg"><wps:Data></div><div class="m_6344686693849570342gmail_msg"><wps:ComplexData mimeType="application/geojson"></div><div class="m_6344686693849570342gmail_msg"><![CDATA[</div><div class="m_6344686693849570342gmail_msg">WwogICJmb28iLCAKICB7CiAgICAiYmFyIjogWwogICAgICAiYmF6IiwgCiAgICAgIG51bGwsIAogICAgICAxLjAsIAogICAgICAyCiAgICBdCiAgfQpd</div><div class="m_6344686693849570342gmail_msg">]]></div><div class="m_6344686693849570342gmail_msg"></wps:ComplexData></div><div class="m_6344686693849570342gmail_msg"></wps:Data></div><div class="m_6344686693849570342gmail_msg"></wps:Output></div><div class="m_6344686693849570342gmail_msg"></wps:ProcessOutputs></div><div class="m_6344686693849570342gmail_msg"></wps:ExecuteResponse></div></div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg">How can i return only JSON, with no XML at all ?</div><div class="m_6344686693849570342gmail_msg"><br class="m_6344686693849570342gmail_msg"></div><div class="m_6344686693849570342gmail_msg">Thank you.</div></div></div></div>
_______________________________________________<br class="m_6344686693849570342gmail_msg">
pywps-dev mailing list<br class="m_6344686693849570342gmail_msg">
<a href="mailto:pywps-dev@lists.osgeo.org" class="m_6344686693849570342gmail_msg" target="_blank">pywps-dev@lists.osgeo.org</a><br class="m_6344686693849570342gmail_msg">
<a href="http://lists.osgeo.org/mailman/listinfo/pywps-dev" rel="noreferrer" class="m_6344686693849570342gmail_msg" target="_blank">http://lists.osgeo.org/mailman/listinfo/pywps-dev</a></blockquote></div></div>
</blockquote></div><br></div>
<br>_______________________________________________<br>pywps-dev mailing list<br>pywps-dev@lists.osgeo.org<br>http://lists.osgeo.org/mailman/listinfo/pywps-dev</blockquote></div></div><br></div></body></html>