Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3972 closed defect (fixed)

WCS 1.0: WCS Exceptions raise mapscript exceptions

Reported by: fschindler Owned by: sdlime
Priority: high Milestone: 6.2 release
Component: WCS Server Version: unspecified
Severity: normal Keywords: WCS exception mapscript
Cc: sdlime, schpidi, tomkralidis, dmorissette, assefa

Description

WCS Exceptions in WCS 1.0 requests called from mapscript applications raise an exception instead of returning a proper result.

For WCS 1.1 and WCS 2.0 this is not the case, as the exception message is normally returned an can be read with the according msIO_... mapscript functions.

The following python application raises the said exception (because the coverage id is not found):

import mapscript

ows_req = mapscript.OWSRequest()
ows_req.setParameter('SERVICE','WCS')
ows_req.setParameter('REQUEST','DescribeCoverage')
ows_req.setParameter('VERSION','1.0.0')
ows_req.setParameter('COVERAGE','invalid_id')

map = mapscript.mapObj('test.map')
mapscript.msIO_installStdoutToBuffer()
dispatch_status = map.OWSDispatch(ows_req)
print mapscript.msIO_getStdoutBufferBytes()

The used map file:

MAP
  CONFIG "MS_ERRORFILE" "stderr"

  WEB
    METADATA
      "ows_onlineresource" "http://something?"
      "ows_enable_request" "*"
    END
  END 

  LAYER
    NAME "a" 
    DUMP TRUE 
    DATA "test.tif" 
    TYPE RASTER 
    METADATA
      "ows_srs" "EPSG:4326"
    END
  END
END

The exception raised:

Traceback (most recent call last):
  File "describe.py", line 13, in <module>
    dispatch_status = map.OWSDispatch(ows_req)
_mapscript.MapServerError: msWCSDescribeCoverage(): WCS server error. COVERAGE invalid_id cannot be opened / does not exist

The problem occurs in msWCSException, as the error stack is not cleared with msResetErrorList, which is done in the other WCS exception handlers.

The following patch resolves the issue:

  • mapwcs.c

     
    179179  msIO_printf("  </ServiceException>\n");
    180180  msIO_printf("</ServiceExceptionReport>\n");
    181181
     182  msResetErrorList();
     183
    182184  return MS_FAILURE;
    183185}

Attachments (1)

r11973_wcs_exception_errorstack.patch (304 bytes ) - added by fschindler 13 years ago.
Patch to resolve the described problem

Download all attachments as: .zip

Change History (3)

by fschindler, 13 years ago

Patch to resolve the described problem

comment:1 by schpidi, 13 years ago

Resolution: fixed
Status: newclosed

Committed with r11980.

comment:2 by schpidi, 13 years ago

Forgot HISTORY.txt 11981.

Note: See TracTickets for help on using tickets.