MCPcopy Index your code
hub / github.com/MapServer/MapServer / msWCSDispatch

Function msWCSDispatch

mapwcs.c:1997–2127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1995/************************************************************************/
1996
1997int msWCSDispatch(mapObj *map, cgiRequestObj *request, owsRequestObj *ows_request)
1998{
1999#ifdef USE_WCS_SVR
2000 wcsParamsObj *params;
2001 int retVal = MS_DONE;
2002
2003 /* First try to dispatch WCS 2.0.0. */
2004 /* TODO: Need to implement proper version negotiation (OWS Common) */
2005 /* once WCS 2.0.0 is fully specified. */
2006 /* Currently WCS 2.0.0 is only available if explicitly requested. */
2007 if ((retVal = msWCSDispatch20(map, request, ows_request)) != MS_DONE )
2008 {
2009 return retVal;
2010 }
2011
2012 /* populate the service parameters */
2013 params = msWCSCreateParams();
2014 if( msWCSParseRequest(request, params, map) == MS_FAILURE )
2015 {
2016 msWCSFreeParams(params); /* clean up */
2017 free(params);
2018 return MS_FAILURE;
2019 }
2020
2021 /* If SERVICE is specified then it MUST be "WCS" */
2022 if(params->service && strcasecmp(params->service, "WCS") != 0)
2023 {
2024 msWCSFreeParams(params); /* clean up */
2025 free(params);
2026 msDebug("msWCSDispatch(): SERVICE is not WCS\n");
2027 return MS_DONE;
2028 }
2029
2030 /* If SERVICE and REQUEST not included then not a WCS request */
2031 if(!params->service && !params->request)
2032 {
2033 msWCSFreeParams(params); /* clean up */
2034 free(params);
2035 msDebug("msWCSDispatch(): SERVICE and REQUEST not included\n");
2036 return MS_DONE;
2037 }
2038
2039 msOWSRequestLayersEnabled(map, "C", params->request, ows_request);
2040 if (ows_request->numlayers == 0)
2041 {
2042 msSetError(MS_WCSERR, "WCS request not enabled. Check wcs/ows_enable_request settings.", "msWCSDispatch()");
2043 msWCSException(map, "InvalidParameterValue", "request",
2044 params->version );
2045 msWCSFreeParams(params); /* clean up */
2046 free(params);
2047 params = NULL;
2048 return MS_FAILURE;
2049 }
2050
2051 /*
2052 ** ok, it's a WCS request, check what we can at a global level and then dispatch to the various request handlers
2053 */
2054

Callers 1

msOWSDispatchFunction · 0.85

Calls 13

msWCSDispatch20Function · 0.85
msWCSCreateParamsFunction · 0.85
msWCSParseRequestFunction · 0.85
msWCSFreeParamsFunction · 0.85
strcasecmpFunction · 0.85
msDebugFunction · 0.85
msSetErrorFunction · 0.85
msWCSExceptionFunction · 0.85
msStrdupFunction · 0.85
msWCSGetCapabilitiesFunction · 0.85
msWCSDescribeCoverageFunction · 0.85

Tested by

no test coverage detected