istSOS / istsos2

Easily manage your sensor network and distribute your data in a standard way
Other
16 stars 31 forks source link

Failing requests for SOS 2.0.0: not parsing procedure names correctly #62

Open pesekon2 opened 4 years ago

pesekon2 commented 4 years ago

Not sure this issue should be opened in this istSOS repo, but as this is the one with interface/admin, hopefully it is the right place

When I try to query the istSOS demo service with SOS version 1.0.0, the following query works without a problem:

http://istsos.org/istsos/demo?service=SOS&
    version=1.0.0&
    request=GetObservation&
    offering=temporary&
    observedProperty=urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall&
    responseFormat=text/xml;subtype="om/1.0.0"&
    eventTime=2015-05-28T00:00:00+0200/2015-06-02T00:00:00+0200&
    procedure=BELLINZONA

However, when I try to change the SOS version (1.0.0 to 2.0.0) and the response format (text/xml;subtype="om/1.0.0" to http://www.opengis.net/om/2.0) as in the following query, I always get an error saying Invalid parameter value in 'procedure' parameter: temporary.

http://istsos.org/istsos/demo?service=SOS&
    version=2.0.0&
    request=GetObservation&
    offering=temporary&
    observedProperty=urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall&
    responseFormat=http://www.opengis.net/om/2.0&
    eventTime=2015-05-28T00:00:00+0200/2015-06-02T00:00:00+0200&
    procedure=BELLINZONA

Seems like the offering attribute is somehow erroneously parsed into the procedure one.

massimiliano-cannata commented 4 years ago

Hi, In sos 2.0 the offering has changed its meaning, so you can skip the parameter or use the same name as the procedure. Look at the interface for available offerings.

Maxi

Il lun 22 giu 2020, 00:33 Ondrej Pesek notifications@github.com ha scritto:

Not sure this issue should be opened in this istSOS repo, but as this is the one with interface/admin, hopefully it is the right place

When I try to query the istSOS demo service with SOS version 1.0.0, the following query works without a problem:

http://istsos.org/istsos/demo?service=SOS& version=1.0.0& request=GetObservation& offering=temporary& observedProperty=urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall& responseFormat=text/xml;subtype="om/1.0.0"& eventTime=2015-05-28T00:00:00+0200/2015-06-02T00:00:00+0200& procedure=BELLINZONA

However, when I try to change the SOS version (1.0.0 to 2.0.0) and the response format (text/xml;subtype="om/1.0.0" to http://www.opengis.net/om/2.0) as in the following query, I always get an error saying Invalid parameter value in 'procedure' parameter: temporary.

http://istsos.org/istsos/demo?service=SOS& version=2.0.0& request=GetObservation& offering=temporary& observedProperty=urn:ogc:def:parameter:x-istsos:1.0:meteo:air:rainfall& responseFormat=http://www.opengis.net/om/2.0& eventTime=2015-05-28T00:00:00+0200/2015-06-02T00:00:00+0200& procedure=BELLINZONA

Seems like the offering attribute is somehow erroneously parsed into the procedure one.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/istSOS/istsos2/issues/62, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADC2FTBE5VDIZIQVY77DISTRX2DE7ANCNFSM4OEBYX2Q .

pesekon2 commented 4 years ago

Okay, that sounds very much like my fault/missing knowledge about SOS 1.0.0/2.0 differences. Thank you. And sorry.

However, after changing it to the procedure name or skipping the parameter, I always end up in this error message. Is it something on my side, or on the server side?

<ExceptionReport xsi:schemaLocation="http://www.opengis.net/ows/1.1 ../owsExceptionReport.xsd" version="1.0.0" xml:lang="en"><Exception exceptionCode="NoApplicableCode"><ExceptionText>
    TypeError
  </ExceptionText><ExceptionText>
    Unicode-objects must be encoded before hashing
  </ExceptionText><ExceptionText>
    ['Traceback (most recent call last):\n', '  File "/usr/share/istsos/application_istsoslib.py", line 95, in executeSos\n    render = FRe.sosFactoryRender(response, sosConfig)\n', '  File "/usr/share/istsos/istsoslib/renderers/factory_render.py", line 47, in sosFactoryRender\n    return GOresponseRender.render(response, sosConfig)\n', '  File "/usr/share/istsos/istsoslib/renderers/GOresponseRender.py", line 60, in render\n    return XMLformat_2_0_0(GO, sosConfig)\n', '  File "/usr/share/istsos/istsoslib/renderers/GOresponseRender.py", line 440, in XMLformat_2_0_0\n    omobservation.set("{%s}id" % ns[\'gml\'], "o_%s" % hashlib.md5(uid).hexdigest())\n', 'TypeError: Unicode-objects must be encoded before hashing\n']
  </ExceptionText></Exception></ExceptionReport>