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

Function msWFSGetCapabilities11

mapwfs11.c:255–487  ·  view source on GitHub ↗

/ msWFSGetCapabilities11 */ / Return the capabilities document for wfs 1.1.0 */ /

Source from the content-addressed store, hash-verified

253/* Return the capabilities document for wfs 1.1.0 */
254/************************************************************************/
255int msWFSGetCapabilities11(mapObj *map, wfsParamsObj *params,
256 cgiRequestObj *req, owsRequestObj *ows_request)
257{
258 xmlDocPtr psDoc = NULL; /* document pointer */
259 xmlNodePtr psRootNode, psMainNode, psNode, psFtNode;
260 xmlNodePtr psTmpNode;
261 const char *updatesequence=NULL;
262 xmlNsPtr psNsOws, psNsXLink, psNsOgc;
263 char *schemalocation = NULL;
264 char *xsi_schemaLocation = NULL;
265
266 char *script_url=NULL, *script_url_encoded=NULL, *formats_list;
267 const char *value = NULL;
268 const char *encoding;
269
270 xmlChar *buffer = NULL;
271 int size = 0, i;
272 msIOContext *context = NULL;
273
274 int ows_version = OWS_1_0_0;
275
276/* -------------------------------------------------------------------- */
277/* Handle updatesequence */
278/* -------------------------------------------------------------------- */
279
280 updatesequence = msOWSLookupMetadata(&(map->web.metadata), "FO", "updatesequence");
281
282 encoding = msOWSLookupMetadata(&(map->web.metadata), "FO", "encoding");
283
284 if (params->pszUpdateSequence != NULL) {
285 i = msOWSNegotiateUpdateSequence(params->pszUpdateSequence, updatesequence);
286 if (i == 0) { /* current */
287 msSetError(MS_WFSERR, "UPDATESEQUENCE parameter (%s) is equal to server (%s)", "msWFSGetCapabilities11()", params->pszUpdateSequence, updatesequence);
288 return msWFSException11(map, "updatesequence", "CurrentUpdateSequence", params->pszVersion);
289 }
290 if (i > 0) { /* invalid */
291 msSetError(MS_WFSERR, "UPDATESEQUENCE parameter (%s) is higher than server (%s)", "msWFSGetCapabilities11()", params->pszUpdateSequence, updatesequence);
292 return msWFSException11(map, "updatesequence", "InvalidUpdateSequence", params->pszVersion);
293 }
294 }
295
296/* -------------------------------------------------------------------- */
297/* Create document. */
298/* -------------------------------------------------------------------- */
299 psDoc = xmlNewDoc(BAD_CAST "1.0");
300
301 psRootNode = xmlNewNode(NULL, BAD_CAST "WFS_Capabilities");
302
303 xmlDocSetRootElement(psDoc, psRootNode);
304
305/* -------------------------------------------------------------------- */
306/* Name spaces */
307/* -------------------------------------------------------------------- */
308 /*default name space*/
309 xmlNewProp(psRootNode, BAD_CAST "xmlns", BAD_CAST "http://www.opengis.net/wfs");
310
311 xmlSetNs(psRootNode, xmlNewNs(psRootNode, BAD_CAST "http://www.opengis.net/gml", BAD_CAST "gml"));
312 xmlSetNs(psRootNode, xmlNewNs(psRootNode, BAD_CAST "http://www.opengis.net/wfs", BAD_CAST "wfs"));

Callers 1

msWFSGetCapabilitiesFunction · 0.85

Calls 15

msOWSLookupMetadataFunction · 0.85
msSetErrorFunction · 0.85
msWFSException11Function · 0.85
msEncodeHTMLEntitiesFunction · 0.85
msOWSGetSchemasLocationFunction · 0.85
msStrdupFunction · 0.85
msStringConcatenateFunction · 0.85
msOWSGetOnlineResourceFunction · 0.85

Tested by

no test coverage detected