Ticket #2560 (closed defect: fixed)

Opened 5 months ago

Last modified 2 months ago

A GetObservation request with an invalid eventTime value sent to a SOS 1.0.0 server must return an exception

Reported by: nsavard Assigned to: tomkralidis
Priority: normal Milestone: 5.2 release
Component: SOS Server Version: svn-trunk (development)
Severity: normal Keywords: OGC,Cite,TEAM,SOS 1.0.0
Cc: assefa

Description

An invalid eventTime in a GetObservation? request sent to a SOS 1.0.0 server must return an exception. Actually all observations are returned.

The exceptionCode must be "InvalidParameterValue?" and the locator "eventTime".

You can test is with the following client application: http://dev1.lan.mapgears.com/manwe/post-tests/

The CITE test is:

getObservation:core-SOS.GetObservation-RequestInvalidEventTime.1 (s0003)

The request is:

URL: http://dev1.lan.mapgears.com/manwe/cgi-bin/mssos100_ogc_cite? Body:

<GetObservation? xmlns="http://www.opengis.net/sos/1.0"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ctl="http://www.occamlab.com/ctl" xmlns:parsers="http://www.occamlab.com/te/parsers" xmlns:ogc="http://www.opengis.net/ogc" xmlns:sos="http://www.opengis.net/sos/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:te="java:com.occamlab.te.TECore" xmlns:sosFunctions="https://cite.opengeospatial.org/sos-1.0.0/src/ctl/functions.xml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wms="http://www.opengis.net/wms" xmlns:gml="http://www.opengis.net/gml" xmlns:om="http://www.opengis.net/om/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" service="SOS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosGetObservation.xsd">

<offering>Water</offering> <eventTime>

<ogc:TM_During>

<ogc:PropertyName>urn:ogc:data:time:iso8601</ogc:PropertyName> <gml:TimePeriod>

<gml:beginPosition>scooby</gml:beginPosition> <gml:endPosition>2007-02-09</gml:endPosition>

</gml:TimePeriod>

</ogc:TM_During>

</eventTime> <observedProperty>WaterQuality?</observedProperty> <responseFormat>text/xml; subtype=om/1.0.0</responseFormat>

</GetObservation>

Attachments

mapogcsos_2560.txt (1.6 kB) - added by assefa on 06/23/08 15:57:46.

Change History

03/26/08 19:50:38 changed by tomkralidis

  • status changed from new to assigned.
  • owner changed from mapserverbugs to tomkralidis.

03/27/08 14:49:56 changed by tomkralidis

  • cc set to assefa.

Norm: how did this get propagated? Our Capabilities XML advertises only support for TM_Equals at this point:

    <ogc:Temporal_Capabilities>
      <ogc:TemporalOperands>
        <ogc:TemporalOperand>gml:TimePeriod</ogc:TemporalOperand>
        <ogc:TemporalOperand>gml:TimeInstant</ogc:TemporalOperand>
      </ogc:TemporalOperands>
      <ogc:TemporalOperators>
        <ogc:TemporalOperator name="TM_Equals"/>
      </ogc:TemporalOperators>
    </ogc:Temporal_Capabilities>

Note that I put in TM_Equals for now when originally updating , but we need to revisit what we support, etc. Assefa: any comments here?

The other issue is that our XML POST support is currently _not_ picking up any parameters like filter or time or FOI (I'm still trying to figure out how to copy a node tree to a string and pass to mapogcfilter.c).

03/27/08 15:36:12 changed by nsavard

Tom: I need to check how this got propagated. I'll come back to you.

(follow-up: ↓ 14 ) 03/27/08 17:35:13 changed by assefa

We support equals and time period (msSOSParseTimeGML) although we need to update that function to parse the xml properly (<ogc:TM_During> instead of expecting at the root <gml:TimePeriod> ). I guess the same case applies of TimeInstant?.

We should then be able to validate the time passed in the parameter using the msParseTime function (for both start and end times and for the time instant) and return an exception if the time sting does not validate.

06/17/08 12:37:57 changed by tomkralidis

Norm: this has been fixed in r7686, as part of #2379). Can you try now and verify?

06/17/08 13:14:59 changed by nsavard

Tom: Even after I updated MapServer I still got all observations.

06/17/08 15:34:21 changed by tomkralidis

Assefa: maptime.c is not checking for bum values:

<gml:TimePeriod>
 <gml:beginPosition>scooby</gml:beginPosition>
 <gml:endPosition>2007-02-09</gml:endPosition>
</gml:TimePeriod> 

Can we check for values like this and throw error if they're not in a time format? We do know that any time value will start with /\d{4}/.

06/23/08 15:57:46 changed by assefa

  • attachment mapogcsos_2560.txt added.

06/23/08 15:58:43 changed by assefa

Tom, I added a patch that should allow to detect for invalid time. Let me know if that works and I will commit.

06/23/08 16:06:14 changed by tomkralidis

Assefa: this patch works. Go ahead and comment. Thanks!

Norm: following this, can you test again verify?

06/23/08 16:06:44 changed by tomkralidis

s/comment/commit/

06/23/08 16:09:38 changed by assefa

patch committed.

06/23/08 16:11:09 changed by assefa

oops forgot revision number for last commit (r7728)

06/23/08 16:19:38 changed by nsavard

RE: comment:9

On my way to test ... compiling MapServer.

(in reply to: ↑ 4 ) 06/23/08 16:31:29 changed by tomkralidis

Replying to assefa:

We support equals and time period (msSOSParseTimeGML) although we need to update that function to parse the xml properly (<ogc:TM_During> instead of expecting at the root <gml:TimePeriod> ). I guess the same case applies of TimeInstant?.

HTTP POST supports this already by traversing to gml:TimePeriod or gml:TimeInstant via xpath.

For HTTP GET, would we have to change mapogcfilter.c, or fake it in mapogcsos.c ?

06/23/08 16:54:00 changed by nsavard

This is fixed.

06/23/08 17:21:46 changed by assefa

The Get should also work without a change since both Get/Post initialize sosparams->pszEventTime and the validity test is done on that parameter.

06/23/08 18:04:52 changed by tomkralidis

  • status changed from assigned to closed.
  • resolution set to fixed.

Right, but the GET request gets this as sosparams->pszEventTime:

<ogc:TM_Equals>
 <gml:TimePeriod>
  <gml:beginPosition>1999</gml:beginPosition>
  <gml:endPosition>2001</gml:endPosition>
 </gml:TimePeriod>
</ogc:TM_Equals>

..but mapogcfilter.c can only process:

 <gml:TimePeriod>
  <gml:beginPosition>1999</gml:beginPosition>
  <gml:endPosition>2001</gml:endPosition>
 </gml:TimePeriod>

I put a fix in r7730 to strip the root elements before passing. This will only happen in GET requests (even though we don't check) because we use XPath for POST.

Closing, since this passes the CITE tests. msautotest/wxs/sos.map works. I've also updated the SOS Server doc examples of eventTime queries.