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

Function msOWSDispatch

mapows.c:50–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48** this as a regular MapServer (traditional CGI) request.
49*/
50int msOWSDispatch(mapObj *map, cgiRequestObj *request, int ows_mode)
51{
52 int i, status = MS_DONE;
53 const char *service=NULL;
54 int force_ows_mode = 0;
55 owsRequestObj ows_request;
56
57 if (!request)
58 return status;
59
60 if (ows_mode == OWS || ows_mode == WFS)
61 force_ows_mode = 1;
62
63 ows_request.numlayers = 0;
64 ows_request.enabled_layers = NULL;
65
66 for( i=0; i<request->NumParams; i++ )
67 {
68 if(strcasecmp(request->ParamNames[i], "SERVICE") == 0)
69 service = request->ParamValues[i];
70 }
71
72#ifdef USE_WMS_SVR
73 /* Note: SERVICE param did not exist in WMS 1.0.0, it was added only in WMS 1.1.0,
74 * so we need to let msWMSDispatch check for known REQUESTs even if SERVICE is not set.
75 */
76 if ((status = msWMSDispatch(map, request, &ows_request, MS_FALSE)) != MS_DONE )
77 {
78 msFree(ows_request.enabled_layers);
79 return status;
80 }
81#else
82 if( service != NULL && strcasecmp(service,"WMS") == 0 )
83 msSetError( MS_WMSERR,
84 "SERVICE=WMS requested, but WMS support not configured in MapServer.",
85 "msOWSDispatch()" );
86#endif
87
88#ifdef USE_WFS_SVR
89 /* Note: WFS supports POST requests, so the SERVICE param may only be in the post data
90 * and not be present in the GET URL
91 */
92 if ((status = msWFSDispatch(map, request, &ows_request, (ows_mode == WFS))) != MS_DONE )
93 {
94 msFree(ows_request.enabled_layers);
95 return status;
96 }
97
98#else
99 if( service != NULL && strcasecmp(service,"WFS") == 0 )
100 msSetError( MS_WFSERR,
101 "SERVICE=WFS requested, but WFS support not configured in MapServer.",
102 "msOWSDispatch()" );
103#endif
104
105#ifdef USE_WCS_SVR
106 if ((status = msWCSDispatch(map, request, &ows_request)) != MS_DONE )
107 {

Callers 2

mainFunction · 0.85
mapObj_OWSDispatchFunction · 0.85

Calls 7

strcasecmpFunction · 0.85
msWMSDispatchFunction · 0.85
msFreeFunction · 0.85
msSetErrorFunction · 0.85
msWFSDispatchFunction · 0.85
msWCSDispatchFunction · 0.85
msSOSDispatchFunction · 0.85

Tested by

no test coverage detected