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

Function msSOSParseRequest

mapogcsos.c:2940–3194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2938#if defined(USE_SOS_SVR) && defined(USE_LIBXML2)
2939
2940int msSOSParseRequest(mapObj *map, cgiRequestObj *request, sosParamsObj *sosparams) {
2941 int i;
2942 xmlDocPtr doc;
2943 xmlXPathContextPtr context;
2944 xmlNodeSetPtr nodeset;
2945 xmlXPathObjectPtr psXPathTmp;
2946 char *pszTmp = NULL;
2947
2948 if (request->NumParams) { /* this is a GET request */
2949 for(i=0; i<request->NumParams; i++) {
2950 if (strcasecmp(request->ParamNames[i], "SERVICE") == 0)
2951 sosparams->pszService = msStrdup(request->ParamValues[i]);
2952 else if (strcasecmp(request->ParamNames[i], "VERSION") == 0)
2953 sosparams->pszVersion = msStrdup(request->ParamValues[i]);
2954 else if (strcasecmp(request->ParamNames[i], "ACCEPTVERSIONS") == 0)
2955 sosparams->pszAcceptVersions = msStrdup(request->ParamValues[i]);
2956 else if (strcasecmp(request->ParamNames[i], "REQUEST") == 0)
2957 sosparams->pszRequest = msStrdup(request->ParamValues[i]);
2958 else if (strcasecmp(request->ParamNames[i], "UPDATESEQUENCE") == 0)
2959 sosparams->pszUpdateSequence = msStrdup(request->ParamValues[i]);
2960 else if (strcasecmp(request->ParamNames[i], "SENSORID") == 0)
2961 sosparams->pszSensorId = msStrdup(request->ParamValues[i]);
2962 else if (strcasecmp(request->ParamNames[i], "PROCEDURE") == 0)
2963 sosparams->pszProcedure = msStrdup(request->ParamValues[i]);
2964 else if (strcasecmp(request->ParamNames[i], "OUTPUTFORMAT") == 0)
2965 sosparams->pszOutputFormat = msStrdup(request->ParamValues[i]);
2966 else if (strcasecmp(request->ParamNames[i], "OFFERING") == 0)
2967 sosparams->pszOffering = msStrdup(request->ParamValues[i]);
2968 else if (strcasecmp(request->ParamNames[i], "OBSERVEDPROPERTY") == 0)
2969 sosparams->pszObservedProperty = msStrdup(request->ParamValues[i]);
2970 else if (strcasecmp(request->ParamNames[i], "EVENTTIME") == 0)
2971 sosparams->pszEventTime = msStrdup(request->ParamValues[i]);
2972 else if (strcasecmp(request->ParamNames[i], "RESULT") == 0)
2973 sosparams->pszResult = msStrdup(request->ParamValues[i]);
2974 else if (strcasecmp(request->ParamNames[i], "RESULTMODEL") == 0)
2975 sosparams->pszResultModel = msStrdup(request->ParamValues[i]);
2976 else if (strcasecmp(request->ParamNames[i], "RESPONSEFORMAT") == 0)
2977 sosparams->pszResponseFormat = msStrdup(request->ParamValues[i]);
2978 else if (strcasecmp(request->ParamNames[i], "RESPONSEMODE") == 0)
2979 sosparams->pszResponseMode = msStrdup(request->ParamValues[i]);
2980 else if (strcasecmp(request->ParamNames[i], "BBOX") == 0)
2981 sosparams->pszBBox = msStrdup(request->ParamValues[i]);
2982 else if (strcasecmp(request->ParamNames[i], "SRSNAME") == 0)
2983 sosparams->pszSrsName = msStrdup(request->ParamValues[i]);
2984 else if (strcasecmp(request->ParamNames[i], "FEATUREOFINTEREST") == 0)
2985 sosparams->pszFeatureOfInterest = msStrdup(request->ParamValues[i]);
2986 }
2987 }
2988
2989 if (request->postrequest) { /* this a POST request */
2990 /* load document */
2991 doc = xmlParseDoc((xmlChar *)request->postrequest);
2992 if (doc == NULL ) {
2993 msSetError(MS_SOSERR, "Invalid POST request. XML is not well-formed", "msSOSParseRequest()");
2994 return msSOSException(map, "request", "InvalidRequest");
2995 }
2996
2997 /* load context */

Callers 1

msSOSDispatchFunction · 0.85

Calls 8

strcasecmpFunction · 0.85
msStrdupFunction · 0.85
msSetErrorFunction · 0.85
msSOSExceptionFunction · 0.85
msLibXml2GetXPathFunction · 0.85
msLibXml2GetXPathTreeFunction · 0.85
msStringConcatenateFunction · 0.85
msFreeFunction · 0.85

Tested by

no test coverage detected