Index: mapfile.c
===================================================================
--- mapfile.c	(revision 13208)
+++ mapfile.c	(working copy)
@@ -76,7 +76,7 @@
 /*      check to see if we shoudl invert the axis.                      */
 /*                                                                      */
 /************************************************************************/
-static int msIsAxisInverted(int epsg_code)
+int msIsAxisInverted(int epsg_code)
 {
     int i;
     /*check the static table*/
Index: mapfile.h
===================================================================
--- mapfile.h	(revision 13208)
+++ mapfile.h	(working copy)
@@ -307,5 +307,6 @@
 /* rfc59 bindvals objects */
 #define BINDVALS 2000
 
+int msIsAxisInverted(int epsg_code);
 
 #endif /* MAPFILE_H */
Index: mapwfs.c
===================================================================
--- mapwfs.c	(revision 13208)
+++ mapwfs.c	(working copy)
@@ -2134,8 +2134,12 @@
     bbox.maxx = atof(tokens[2]);
     bbox.maxy = atof(tokens[3]);
     /*5th aregument is assumed to be projection*/
-    if (n == 5)
+    if (n == 5){
       sBBoxSrs = msStrdup(tokens[4]);
+    }
+    else  {
+      sBBoxSrs = msStrdup(msOWSGetEPSGProj(&(map->projection), &(map->web.metadata), "FO", MS_TRUE));
+    }
 
     msFreeCharArray(tokens, n);
     bBBOXSet = 1;
Index: mapwfslayer.c
===================================================================
--- mapwfslayer.c	(revision 13208)
+++ mapwfslayer.c	(working copy)
@@ -29,6 +29,7 @@
 #include "mapserver.h"
 #include "maperror.h"
 #include "mapows.h"
+#include "mapfile.h"
 
 #include <time.h>
 #include <assert.h>
@@ -431,10 +432,41 @@
         snprintf(pszURL + strlen(pszURL), bufferSize-strlen(pszURL), "&FILTER=%s",
                  msEncodeUrl(psParams->pszFilter));
     }
-    else
-      snprintf(pszURL + strlen(pszURL), bufferSize-strlen(pszURL), 
-               "&BBOX=%.15g,%.15g,%.15g,%.15g",
-               bbox->minx, bbox->miny, bbox->maxx, bbox->maxy);
+    else {
+        /* 
+         * take care about the axis order for WFS 1.1
+         */
+
+        char *projUrn;
+        char *projEpsg;
+        projUrn = msOWSGetProjURN(&(lp->projection), &(lp->metadata), "FO", MS_FALSE);
+        projEpsg = msOWSGetEPSGProj(&(lp->projection), NULL, NULL, MS_TRUE);
+
+        if (strncmp(pszVersion,"1.1",3) == NULL && 
+                lp->projection.numargs > 0 && 
+                msIsAxisInverted(atoi(projEpsg+5))) {
+
+            if (projUrn) {
+                snprintf(pszURL + strlen(pszURL), bufferSize-strlen(pszURL), 
+                    "&BBOX=%.15g,%.15g,%.15g,%.15g,%s",
+                    bbox->miny, bbox->minx, bbox->maxy, bbox->maxx,projUrn);
+            }
+            else {
+                snprintf(pszURL + strlen(pszURL), bufferSize-strlen(pszURL), 
+                    "&BBOX=%.15g,%.15g,%.15g,%.15g",
+                    bbox->miny, bbox->minx, bbox->maxy, bbox->maxx);
+            }
+
+        }
+        else {
+            snprintf(pszURL + strlen(pszURL), bufferSize-strlen(pszURL), 
+                "&BBOX=%.15g,%.15g,%.15g,%.15g",
+                bbox->minx, bbox->miny, bbox->maxx, bbox->maxy);
+        }
+
+        free(projUrn);
+        projUrn = NULL;
+    }
     
     if (psParams->nMaxFeatures > 0)
       snprintf(pszURL + strlen(pszURL), bufferSize-strlen(pszURL),
@@ -1056,6 +1088,7 @@
     msWFSLayerInfo *psInfo;
     int status = MS_SUCCESS;
     const char *pszTmp;
+    char *projEpsg;
     FILE *fp;
     
     if ( msCheckParentPointer(lp->map,"map")==MS_FAILURE )
@@ -1203,6 +1236,17 @@
         /* If we got this far, it must be a valid GML dataset... keep going */
     }
 
+/* ------------------------------------------------------------------
+ * take care about the axis order for WFS 1.1: Tell GDAL to invert axis
+ * ------------------------------------------------------------------ */
+    pszTmp = msOWSLookupMetadata(&(lp->metadata), "FO", "version");
+    projEpsg = msOWSGetEPSGProj(&(lp->projection), NULL, NULL, MS_TRUE);
+    if (strncmp(pszTmp,"1.1",3) == NULL && 
+                lp->projection.numargs > 0 && 
+                msIsAxisInverted(atoi(projEpsg+5))) {
+        CPLSetConfigOption("GML_INVERT_AXIS_ORDER_IF_LAT_LONG","YES");
+        CPLSetConfigOption("GML_CONSIDER_EPSG_AS_URN","YES");
+    }
 
 /* ------------------------------------------------------------------
  * Open GML file using OGR.
