Permalink
Browse files

add XML namespace for WFS Client requests (#4467)

closes #4467
  • Loading branch information...
1 parent 656e595 commit 1903b7a0dd92dbaba480ea5e9b9d807832e1fc4b @yjacolin yjacolin committed with tbonfort Sep 22, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 mapwfslayer.c
View
@@ -153,7 +153,7 @@ static wfsParamsObj *msBuildRequestParams(mapObj *map, layerObj *lp,
if (strstr(pszTmp, "<Filter>") !=NULL || strstr(pszTmp, "<ogc:Filter") != NULL)
psParams->pszFilter = msStrdup(pszTmp);
else {
- psParams->pszFilter = msStringConcatenate(psParams->pszFilter, "<ogc:Filter>");
+ psParams->pszFilter = msStringConcatenate(psParams->pszFilter, "<ogc:Filter xmlns:ogc=\"http://www.opengis.net/ogc\">");
psParams->pszFilter = msStringConcatenate(psParams->pszFilter, (char*)pszTmp);
psParams->pszFilter = msStringConcatenate(psParams->pszFilter, "</ogc:Filter>");
}
@@ -263,7 +263,8 @@ static char *msBuildWFSLayerPostRequest(mapObj *map, layerObj *lp,
"service=\"WFS\"\n"
"version=\"1.0.0\"\n"
"maxFeatures=\"%d\"\n"
- "outputFormat=\"GML2\">\n"
+ "outputFormat=\"GML2\"\n"
+ "xmlns:wfs=\"http://www.opengis.net/wfs\" xmlns:ogc=\"http://www.opengis.net/ogc\" xsi:schemaLocation=\"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:gml=\"http://www.opengis.net/gml\">\n"
"<wfs:Query typeName=\"%s\">\n"
"%s"
"</wfs:Query>\n"
@@ -273,7 +274,8 @@ static char *msBuildWFSLayerPostRequest(mapObj *map, layerObj *lp,
"<wfs:GetFeature\n"
"service=\"WFS\"\n"
"version=\"1.0.0\"\n"
- "outputFormat=\"GML2\">\n"
+ "outputFormat=\"GML2\"\n"
+ "xmlns:wfs=\"http://www.opengis.net/wfs\" xmlns:ogc=\"http://www.opengis.net/ogc\" xsi:schemaLocation=\"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:gml=\"http://www.opengis.net/gml\">\n"
"<wfs:Query typeName=\"%s\">\n"
"%s"
"</wfs:Query>\n"

0 comments on commit 1903b7a

Please sign in to comment.