Index: trunk/zoo-kernel/service_internal.c
===================================================================
--- trunk/zoo-kernel/service_internal.c	(revision 50)
+++ trunk/zoo-kernel/service_internal.c	(revision 52)
@@ -1493,4 +1493,9 @@
     if(toto!=NULL && strcasecmp(toto->value,"true")==0){
       toto=getMap(request_outputs->content,"extension");
+      /* put gml extension if the extension is defined as .js and the result will be a gml file */
+      map* mtype=getMap(request_outputs->content,"mimeType");
+      if (strcasecmp(toto->value,"js")==0 && strcasecmp(mtype->value,"text/xml")==0) {
+	toto->value="gml";
+      }
       map *tmp1=getMapFromMaps(m,"main","tmpPath");
       char *file_name=(char*)malloc((strlen(tmp1->value)+strlen(s->name)+strlen(toto->value)+13)*sizeof(char));
