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

Function msWCSParseRequest20

mapwcs20.c:983–1354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

981/************************************************************************/
982
983int msWCSParseRequest20(cgiRequestObj *request, wcs20ParamsObjPtr params)
984{
985 int i;
986 if (params == NULL || request == NULL)
987 {
988 msSetError(MS_WCSERR, "Internal error.", "msWCSParseRequest20()");
989 return MS_FAILURE;
990 }
991
992 /* Parse the POST request */
993 if (request->type == MS_POST_REQUEST && request->postrequest &&
994 strlen(request->postrequest))
995 {
996#if defined(USE_LIBXML2)
997 xmlDocPtr doc = NULL;
998 xmlNodePtr root = NULL;
999 int ret = MS_SUCCESS;
1000
1001 msDebug("msWCSParseRequest20(): Parsing request %s\n",
1002 request->postrequest);
1003
1004 if (params->version != NULL
1005 || params->request != NULL
1006 || params->service != NULL
1007 || params->ids != NULL
1008 || params->axes != NULL)
1009 {
1010 msSetError(MS_WCSERR, "Params object has already been parsed",
1011 "msWCSParseRequest20()");
1012 return MS_FAILURE;
1013 }
1014
1015 /* parse to DOM-Structure and get root element */
1016 doc = xmlParseMemory(request->postrequest, strlen(request->postrequest));
1017 if(doc == NULL)
1018 {
1019 xmlErrorPtr error = xmlGetLastError();
1020 msSetError(MS_WCSERR, "XML parsing error: %s",
1021 "msWCSParseRequest20()", error->message);
1022 return MS_FAILURE;
1023 }
1024 root = xmlDocGetRootElement(doc);
1025
1026 /* Get service, version and request from root */
1027 params->request = msStrdup((char *) root->name);
1028 params->service = (char *) xmlGetProp(root, BAD_CAST "service");
1029 params->version = (char *) xmlGetProp(root, BAD_CAST "version");
1030
1031 if(params->service != NULL && EQUAL(params->service, "WCS"))
1032 {
1033 if(EQUAL(params->request, "GetCapabilities"))
1034 {
1035 ret = msWCSParseRequest20_XMLGetCapabilities(root, params);
1036 }
1037 else if(params->version != NULL && EQUALN(params->version, "2.0", 3))
1038 {
1039 if(EQUAL(params->request, "DescribeCoverage"))
1040 {

Callers 1

msWCSDispatch20Function · 0.85

Calls 15

msSetErrorFunction · 0.85
msDebugFunction · 0.85
msStrdupFunction · 0.85
msStringSplitFunction · 0.85
msFreeCharArrayFunction · 0.85
msWCSParseSizeString20Function · 0.85
msWCSFindAxis20Function · 0.85
msWCSCreateAxisObj20Function · 0.85
msWCSInsertAxisObj20Function · 0.85

Tested by

no test coverage detected