| 1995 | /************************************************************************/ |
| 1996 | |
| 1997 | int 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 |
no test coverage detected