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

Function msWMSGetCapabilities

mapwms.c:2002–2723  ·  view source on GitHub ↗

** msWMSGetCapabilities() */

Source from the content-addressed store, hash-verified

2000** msWMSGetCapabilities()
2001*/
2002int msWMSGetCapabilities(mapObj *map, int nVersion, cgiRequestObj *req, owsRequestObj *ows_request,
2003 const char *requested_updatesequence, char *wms_exception_format)
2004{
2005 char *dtd_url = NULL;
2006 char *script_url=NULL, *script_url_encoded=NULL;
2007
2008 char szVersionBuf[OWS_VERSION_MAXLEN];
2009 char *schemalocation = NULL;
2010 const char *updatesequence=NULL;
2011 const char *sldenabled=NULL;
2012 const char *encoding;
2013 const char *layerlimit=NULL;
2014 char *pszTmp=NULL;
2015 int i;
2016 const char *format_list=NULL;
2017 char **tokens = NULL;
2018 int numtokens = 0;
2019
2020 updatesequence = msOWSLookupMetadata(&(map->web.metadata), "MO", "updatesequence");
2021
2022 sldenabled = msOWSLookupMetadata(&(map->web.metadata), "MO", "sld_enabled");
2023
2024 encoding = msOWSLookupMetadata(&(map->web.metadata), "MO", "encoding");
2025
2026 if (sldenabled == NULL)
2027 sldenabled = "true";
2028
2029 if (requested_updatesequence != NULL) {
2030 i = msOWSNegotiateUpdateSequence(requested_updatesequence, updatesequence);
2031 if (i == 0) { /* current */
2032 msSetError(MS_WMSERR, "UPDATESEQUENCE parameter (%s) is equal to server (%s)", "msWMSGetCapabilities()", requested_updatesequence, updatesequence);
2033 return msWMSException(map, nVersion, "CurrentUpdateSequence", wms_exception_format);
2034 }
2035 if (i > 0) { /* invalid */
2036 msSetError(MS_WMSERR, "UPDATESEQUENCE parameter (%s) is higher than server (%s)", "msWMSGetCapabilities()", requested_updatesequence, updatesequence);
2037 return msWMSException(map, nVersion, "InvalidUpdateSequence", wms_exception_format);
2038 }
2039 }
2040
2041 schemalocation = msEncodeHTMLEntities( msOWSGetSchemasLocation(map) );
2042
2043 if (nVersion < 0)
2044 nVersion = OWS_1_3_0; /* Default to 1.3.0 */
2045
2046 /* Decide which version we're going to return. */
2047 if (nVersion < OWS_1_0_7) {
2048 nVersion = OWS_1_0_0;
2049 dtd_url = msStrdup(schemalocation);
2050 dtd_url = msStringConcatenate(dtd_url, "/wms/1.0.0/capabilities_1_0_0.dtd");
2051 }
2052
2053 else if (nVersion < OWS_1_1_0) {
2054 nVersion = OWS_1_0_7;
2055 dtd_url = msStrdup(schemalocation);
2056 dtd_url = msStringConcatenate(dtd_url, "/wms/1.0.7/capabilities_1_0_7.dtd");
2057 }
2058 else if (nVersion < OWS_1_1_1) {
2059 nVersion = OWS_1_1_0;

Callers 1

msWMSDispatchFunction · 0.85

Calls 15

msOWSLookupMetadataFunction · 0.85
msSetErrorFunction · 0.85
msWMSExceptionFunction · 0.85
msEncodeHTMLEntitiesFunction · 0.85
msOWSGetSchemasLocationFunction · 0.85
msStrdupFunction · 0.85
msStringConcatenateFunction · 0.85
strcasecmpFunction · 0.85
msOWSGetOnlineResourceFunction · 0.85
msIO_printfFunction · 0.85
msOWSPrintEncodeMetadataFunction · 0.85

Tested by

no test coverage detected