Opened 16 years ago

Closed 16 years ago

#2560 closed defect (fixed)

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

Reported by: nsavard Owned by: 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 (1)

mapogcsos_2560.txt (1.6 KB ) - added by assefa 16 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 by tomkralidis, 16 years ago

Owner: changed from mapserverbugs to tomkralidis
Status: newassigned

comment:2 by tomkralidis, 16 years ago

Cc: assefa added

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).

comment:3 by nsavard, 16 years ago

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

comment:4 by assefa, 16 years ago

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.

comment:5 by tomkralidis, 16 years ago

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

comment:6 by nsavard, 16 years ago

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

comment:7 by tomkralidis, 16 years ago

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}/.

by assefa, 16 years ago

Attachment: mapogcsos_2560.txt added

comment:8 by assefa, 16 years ago

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

comment:9 by tomkralidis, 16 years ago

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

Norm: following this, can you test again verify?

comment:10 by tomkralidis, 16 years ago

s/comment/commit/

comment:11 by assefa, 16 years ago

patch committed.

comment:12 by assefa, 16 years ago

oops forgot revision number for last commit (r7728)

comment:13 by nsavard, 16 years ago

RE: comment:9

On my way to test ... compiling MapServer.

in reply to:  4 comment:14 by tomkralidis, 16 years ago

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 ?

comment:15 by nsavard, 16 years ago

This is fixed.

comment:16 by assefa, 16 years ago

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

comment:17 by tomkralidis, 16 years ago

Resolution: fixed
Status: assignedclosed

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.

Note: See TracTickets for help on using tickets.