Index: /trunk/zoo-project/zoo-kernel/Makefile.in
===================================================================
--- /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 744)
+++ /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 745)
@@ -94,5 +94,5 @@
 
 libzoo_service.${EXT}: version.h service_internal.o service.o sqlapi.o
-	gcc -shared  ${GDAL_CFLAGS} ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS}  service_internal.o service.o sqlapi.o -lfcgi ${GDAL_LIBS}
+	gcc -shared  ${GDAL_CFLAGS} ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS}  service_internal.o service.o sqlapi.o ${FCGI_LDFLAGS} ${GDAL_LIBS}
 
 zoo_loader.cgi: version.h libzoo_service.${EXT} zoo_loader.c zoo_service_loader.o  ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o request_parser.o response_print.o server_internal.o caching.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE}
Index: /trunk/zoo-project/zoo-kernel/request_parser.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/request_parser.c	(revision 744)
+++ /trunk/zoo-project/zoo-kernel/request_parser.c	(revision 745)
@@ -483,4 +483,26 @@
 
 /**
+ * Create a "missingIdentifier" maps in case it is NULL.
+ *
+ * @param main_conf the conf maps containing the main.cfg settings
+ * @param mymaps the maps to update
+ * @return 0 on success, 4 on failure
+ */
+int defineMissingIdentifier(maps** main_conf,maps** mymaps){
+  if (*mymaps == NULL){
+    *mymaps = (maps *) malloc (MAPS_SIZE);
+    if (*mymaps == NULL){
+      return errorException (*main_conf,
+			     _("Unable to allocate memory"),
+			     "InternalError", NULL);
+    }
+    (*mymaps)->name = zStrdup ("missingIndetifier");
+    (*mymaps)->content = NULL;
+    (*mymaps)->next = NULL;
+  }
+  return 0;
+}
+
+/**
  * Parse inputs from XML nodes and store them in a maps.
  *
@@ -528,5 +550,5 @@
 		  xmlChar *val =
 		    xmlNodeListGetString (doc, cur2->xmlChildrenNode, 1);
-		  if (tmpmaps == NULL)
+		  if (tmpmaps == NULL && val!=NULL)
 		    {
 		      tmpmaps = (maps *) malloc (MAPS_SIZE);
@@ -541,6 +563,6 @@
 		      tmpmaps->content = NULL;
 		      tmpmaps->next = NULL;
+		      xmlFree (val);
 		    }
-		  xmlFree (val);
 		}
 	      // Title, Asbtract
@@ -553,33 +575,19 @@
 		  xmlChar *val =
 		    xmlNodeListGetString (doc, cur2->xmlChildrenNode, 1);
-		  if (tmpmaps == NULL)
-		    {
-		      tmpmaps = (maps *) malloc (MAPS_SIZE);
-		      if (tmpmaps == NULL)
-			{
-			  return errorException (*main_conf,
-						 _
-						 ("Unable to allocate memory"),
-						 "InternalError", NULL);
-			}
-		      tmpmaps->name = zStrdup ("missingIndetifier");
+		  defineMissingIdentifier(main_conf,&tmpmaps);
+		  if(val!=NULL){
+		    if (tmpmaps->content != NULL)
+		      addToMap (tmpmaps->content,
+				(char *) cur2->name, (char *) val);
+		    else
 		      tmpmaps->content =
 			createMap ((char *) cur2->name, (char *) val);
-		      tmpmaps->next = NULL;
-		    }
-		  else
-		    {
-		      if (tmpmaps->content != NULL)
-			addToMap (tmpmaps->content,
-				  (char *) cur2->name, (char *) val);
-		      else
-			tmpmaps->content =
-			  createMap ((char *) cur2->name, (char *) val);
-		    }
-		  xmlFree (val);
+		    xmlFree (val);
+		  }
 		}
 	      // InputDataFormChoice (Reference or Data ?) 
 	      if (xmlStrcasecmp (cur2->name, BAD_CAST "Reference") == 0)
 		{
+		  defineMissingIdentifier(main_conf,&tmpmaps);
 		  // Get every attribute from a Reference node
 		  // mimeType, encoding, schema, href, method
@@ -721,6 +729,6 @@
 
 				      sprintf (tmp, "%s", (char*) btmps);
-					  
-				      xmlFreeDoc (bdoc);
+
+				      //xmlFreeDoc (bdoc);
 					  
 				      map *btmp =
@@ -815,4 +823,5 @@
 	      else if (xmlStrcasecmp (cur2->name, BAD_CAST "Data") == 0)
 		{
+		  defineMissingIdentifier(main_conf,&tmpmaps);
 		  xmlNodePtr cur4 = cur2->children;
 		  if(vid==1){
@@ -946,4 +955,6 @@
 				     && cur5->type != XML_CDATA_SECTION_NODE)
 				cur5 = cur5->next;
+			      fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
+			      fflush(stderr);
 			      if (cur5 != NULL
 				  && cur5->type != XML_CDATA_SECTION_NODE)
@@ -953,7 +964,4 @@
 							     &buffersize,
 							     "utf-8", 0);
-				  addIntToMap (tmpmaps->content, "size",
-					       buffersize);
-				  xmlFreeDoc (doc1);
 				}
 			      else
@@ -961,14 +969,15 @@
 				  if (cur5 != NULL
 				      && cur5->type == XML_CDATA_SECTION_NODE){
-				    xmlDocPtr doc2 = xmlParseMemory((const char*)cur5->content,xmlStrlen(cur5->content));
-				    xmlDocSetRootElement (doc1,xmlDocGetRootElement(doc2));
-				    xmlDocDumpFormatMemoryEnc (doc1, &mv,
+				    xmlDocPtr doc2 = xmlReadMemory((const char*)cur5->content,xmlStrlen(cur5->content),
+								   "input_content.xml", NULL, XML_PARSE_RECOVER);
+				    xmlDocDumpFormatMemoryEnc (doc2, &mv,
 							       &buffersize,
 							       "utf-8", 0);
-				    addIntToMap(tmpmaps->content, "size",buffersize);
 				    xmlFreeDoc (doc2);
-				    xmlFreeDoc (doc1);
 				  }
 				}
+			      addIntToMap (tmpmaps->content, "size",
+					   buffersize);
+			      xmlFreeDoc (doc1);
 			    }else{
 			    xmlNodePtr cur5 = cur4->children;
@@ -1008,4 +1017,7 @@
 	    }
 	  {
+	    map* test=getMap(tmpmaps->content,"value");
+	    if(test==NULL)
+	      addToMap(tmpmaps->content,"value","");
 	    maps *testPresence =
 	      getMaps (*request_output, tmpmaps->name);
@@ -1324,5 +1336,5 @@
 
   xmlInitParser ();
-  xmlDocPtr doc = xmlParseMemory (post, cgiContentLength);
+  xmlDocPtr doc = xmlReadMemory (post, cgiContentLength, "input_request.xml", NULL, XML_PARSE_RECOVER);
 
   /**
Index: /trunk/zoo-project/zoo-kernel/service_yaml.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/service_yaml.c	(revision 744)
+++ /trunk/zoo-project/zoo-kernel/service_yaml.c	(revision 745)
@@ -46,5 +46,5 @@
  */
 int getServiceFromYAML(maps* conf, char* file,service** service,char *name){
-  FILE *fh = fopen("test.yml", "r");
+  FILE *fh;
   if(current_content!=NULL){
     freeMap(&current_content);
Index: /trunk/zoo-project/zoo-kernel/zoo_loader.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/zoo_loader.c	(revision 744)
+++ /trunk/zoo-project/zoo-kernel/zoo_loader.c	(revision 745)
@@ -216,5 +216,5 @@
       addToMap(tmpMap,"xrequest",t1->value);
       xmlInitParser();
-      xmlDocPtr doc = xmlParseMemory(t1->value,cgiContentLength);
+      xmlDocPtr doc = xmlReadMemory(t1->value, cgiContentLength, "input_request.xml", NULL, XML_PARSE_RECOVER);
       {
 	xmlXPathObjectPtr reqptr=extractFromDoc(doc,"/*[local-name()='Envelope']/*[local-name()='Body']/*");
Index: /trunk/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 744)
+++ /trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 745)
@@ -961,5 +961,5 @@
       setenv ("LC_ALL", tmp, 1);
 #else
-	  char tmp1[13];
+      char tmp1[13];
       sprintf (tmp1, "LC_ALL=%s", tmp);
       putenv (tmp1);
@@ -973,5 +973,5 @@
       setenv ("LC_ALL", "en_US", 1);
 #else
-	  char tmp1[13];
+      char tmp1[13];
       sprintf (tmp1, "LC_ALL=en_US");
       putenv (tmp1);
@@ -979,5 +979,12 @@
       setMapInMaps (m, "main", "language", "en-US");
     }
-  setlocale (LC_NUMERIC, "en_US");
+  setlocale (LC_NUMERIC, "C");
+#ifndef WIN32
+  setenv ("LC_NUMERIC", "C", 1);
+#else
+  char tmp1[17];
+  sprintf (tmp1, "LC_NUMERIC=C");
+  putenv (tmp1);
+#endif
   bind_textdomain_codeset ("zoo-kernel", "UTF-8");
   textdomain ("zoo-kernel");
