Index: branches/prototype-v0/zoo-project/zoo-kernel/Makefile.in
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/Makefile.in	(revision 900)
+++ branches/prototype-v0/zoo-project/zoo-kernel/Makefile.in	(revision 902)
@@ -66,5 +66,5 @@
 
 service_yaml.o: service_yaml.c service.h
-	g++ ${YAML_CFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_yaml.c
+	gcc ${YAML_CFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_yaml.c
 
 meta_sql.o: meta_sql.c meta_sql.h service.h
@@ -121,5 +121,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 ${FCGI_LDFLAGS} ${GDAL_LIBS} ${ZOO_LDFLAGS}
+	g++ -shared  ${GDAL_CFLAGS} ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS}  service_internal.o service.o sqlapi.o ${FCGI_LDFLAGS} ${GDAL_LIBS} ${ZOO_LDFLAGS} ${MACOS_LD_FLAGS}
 
 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} ${R_FILE} ${SAGA_FILE} ${HPC_FILES} ${METADB_FILE} ${JSON_FILE} service_callback.o
Index: branches/prototype-v0/zoo-project/zoo-kernel/ZOOMakefile.opts.in
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/ZOOMakefile.opts.in	(revision 900)
+++ branches/prototype-v0/zoo-project/zoo-kernel/ZOOMakefile.opts.in	(revision 902)
@@ -93,5 +93,4 @@
 PHP_FILE=@PHP_FILE@
 
-
 PERLCFLAGS=@PERL_CPPFLAGS@
 PERLLDFLAGS=@PERL_LDFLAGS@
@@ -103,4 +102,7 @@
 HPC_ENABLED=@HPC_ENABLED@
 HPC_FILES=@HPC_FILES@
+
+CALLBACK_FILE=@CALLBACK_FILE@
+CALLBACK_USE=@CALLBACK_USE@
 
 OTBCFLAGS=@OTB_CPPFLAGS@
@@ -119,6 +121,6 @@
 MONO_FILE=@MONO_FILE@
 
-CFLAGS=@SSH2_CPPFLAGS@ @PROJ_CPPFLAGS@ @RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ @UUID_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
-LDFLAGS=-lzoo_service @SSH2_LDFLAGS@ @PROJ_LDFLAGS@ @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS}  ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} ${RLDFLAGS} @JSON_LDFLAGS@ @XSLT_LDFLAGS@
+CFLAGS=@CALLBACK_USE@ @SSH2_CPPFLAGS@ @PROJ_CPPFLAGS@ @RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ @UUID_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
+LDFLAGS=-lzoo_service @SSH2_LDFLAGS@ @PROJ_LDFLAGS@ @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS}  ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} ${RLDFLAGS} @JSON_LDFLAGS@ @XSLT_LDFLAGS@
 
 DATAROOTDIR=@datarootdir@/zoo-project
Index: branches/prototype-v0/zoo-project/zoo-kernel/configure.ac
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/configure.ac	(revision 900)
+++ branches/prototype-v0/zoo-project/zoo-kernel/configure.ac	(revision 902)
@@ -65,8 +65,12 @@
 #============================================================================
 
+AC_ARG_WITH([callback],
+    [AS_HELP_STRING([--with-callback=yes], [Activate callback invocation during HPC execution])],
+    [CALLBACK_ACTIVATED="$withval"], [CALLBACK_ACTIVATED="no"])
+    
 AC_ARG_WITH([json],
     [AS_HELP_STRING([--with-json=PATH], [Specifies an alternative location for the json-c library])],
     [JSON_DIR="$withval"], [JSON_DIR="/usr/"])
-if test "x$JSON_DIR" != "x"
+if test "x$JSON_DIR" != "x" && test "x$CALLBACK_ACTIVATED" == "xyes"
 then
 	JSON_CPPFLAGS="-I$JSON_DIR/include/json-c/"
@@ -83,4 +87,6 @@
 	JSON_FILE="service_json.o"
 	JSON_ENABLED="-DJSON"
+	CALLBACK_FILE="service_callback.o"
+	CALLBACK_USE="-DUSE_CALLBACK"
 fi
 AC_SUBST([JSON_CPPFLAGS])
@@ -88,4 +94,6 @@
 AC_SUBST([JSON_FILE])
 AC_SUBST([JSON_ENABLED])
+AC_SUBST([CALLBACK_FILE])
+AC_SUBST([CALLBACK_USE])
 
 #============================================================================
Index: branches/prototype-v0/zoo-project/zoo-kernel/response_print.c
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/response_print.c	(revision 900)
+++ branches/prototype-v0/zoo-project/zoo-kernel/response_print.c	(revision 902)
@@ -33,5 +33,5 @@
 #include "cpl_vsi.h"
 #endif
-#ifdef USE_HPC
+#ifdef USE_CALLBACK
 #include "service_callback.h"
 #endif
@@ -1990,5 +1990,4 @@
       nc = xmlNewNode(ns, BAD_CAST "ProcessOutputs");
     }
-    //dumpMaps(outputs);
     maps* mcursor=outputs;
     elements* scursor=serv->outputs;
@@ -2901,6 +2900,5 @@
     else{
       maps* tmpMaps=getMaps(m,"lenv");
-      dumpMap(tmpMaps->content);
-#ifdef USE_HPC
+#ifdef USE_CALLBACK
       invokeCallback(m,NULL,NULL,7,0);
 #endif
Index: branches/prototype-v0/zoo-project/zoo-kernel/server_internal.c
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/server_internal.c	(revision 900)
+++ branches/prototype-v0/zoo-project/zoo-kernel/server_internal.c	(revision 902)
@@ -26,5 +26,5 @@
 #include "service_internal.h"
 #include "response_print.h"
-#include "service_callback.h"
+//#include "service_callback.h"
 #include "mimetypes.h"
 #ifndef WIN32
Index: branches/prototype-v0/zoo-project/zoo-kernel/service_internal_hpc.c
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/service_internal_hpc.c	(revision 900)
+++ branches/prototype-v0/zoo-project/zoo-kernel/service_internal_hpc.c	(revision 902)
@@ -471,8 +471,12 @@
   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
 #endif
+#ifdef USE_CALLBACK
   invokeCallback(m,inputs,NULL,1,1);
   invokeCallback(m,inputs,NULL,2,0);
+#endif  
   if(getMapFromMaps(m,"lenv","mapError")!=NULL){
+#ifdef USE_CALLBACK
     invokeCallback(*main_conf,inputs,NULL,7,0);
+#endif
     return -1;
   }
@@ -489,5 +493,7 @@
     fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
 #endif
+#ifdef USE_CALLBACK
     invokeCallback(*main_conf,inputs,NULL,7,0);
+#endif
 #ifdef HPC_DEBUG
     fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -498,5 +504,7 @@
   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
 #endif
+#ifdef USE_CALLBACK
   invokeCallback(m,inputs,NULL,2,1);
+#endif
 #ifdef HPC_DEBUG
   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -611,5 +619,7 @@
   fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
   invokeCallback(m,inputs,NULL,3,0);
+#endif
 #ifdef HPC_DEBUG
   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -708,5 +718,7 @@
   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
 #endif
+#ifdef USE_CALLBACK
   invokeCallback(m,inputs,NULL,3,1);
+#endif
 #ifdef HPC_DEBUG
   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -717,5 +729,7 @@
   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
 #endif
+#ifdef USE_CALLBACK
   invokeCallback(m,inputs,NULL,4,0);
+#endif
 #ifdef HPC_DEBUG
   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -731,5 +745,7 @@
     fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
     invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
 #ifdef HPC_DEBUG
     fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -748,5 +764,7 @@
   if(copy0!=true){
     setMapInMaps(*main_conf,"lenv","message",_("Unable to upload the script"));
+#ifdef USE_CALLBACK
     invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
     errorException(*main_conf,_("Unable to upload the script"),"NoApplicableCode",NULL);
     return -1;
@@ -790,5 +808,7 @@
     fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
     invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
 #ifdef HPC_DEBUG
     fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -808,5 +828,7 @@
   fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
   invokeCallback(m,NULL,NULL,4,1);
+#endif
 #ifdef HPC_DEBUG
   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -836,5 +858,7 @@
     fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
     invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
     removeReadLocks(main_conf);
 #ifdef HPC_DEBUG
@@ -856,5 +880,7 @@
     fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
     invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
     removeReadLocks(main_conf);
 #ifdef HPC_DEBUG
@@ -872,5 +898,7 @@
     fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
     invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
     removeReadLocks(main_conf);
 #ifdef HPC_DEBUG
@@ -896,5 +924,7 @@
 	fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
 	invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
 	removeReadLocks(main_conf);
 #ifdef HPC_DEBUG
@@ -912,5 +942,7 @@
 	  fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
 	  invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
 	  removeReadLocks(main_conf);
 #ifdef HPC_DEBUG
@@ -932,5 +964,7 @@
 	fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
 	invokeCallback(m,NULL,outputs,5,0);
+#endif
 #ifdef HPC_DEBUG
 	fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -1006,5 +1040,7 @@
                   free(tmpStr);
                 }
+#ifdef USE_CALLBACK
 		invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
 		return SERVICE_FAILED;
 	      }
@@ -1083,5 +1119,7 @@
 		  free(tmpStr);
 		}
+#ifdef USE_CALLBACK
                 invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
                 return SERVICE_FAILED;
 	      }
@@ -1101,5 +1139,7 @@
 	fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
 	invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
 #ifdef HPC_DEBUG
 	fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
@@ -1117,5 +1157,7 @@
       fflush(stderr);
 #endif
+#ifdef USE_CALLBACK
       invokeCallback(*main_conf,NULL,NULL,7,0);
+#endif
 #ifdef HPC_DEBUG
       fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
Index: branches/prototype-v0/zoo-project/zoo-kernel/service_yaml.c
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/service_yaml.c	(revision 900)
+++ branches/prototype-v0/zoo-project/zoo-kernel/service_yaml.c	(revision 902)
@@ -487,5 +487,5 @@
 	      addMapToIoType(&current_element->supported,current_content);
 	  }
-	  freeMaps(&current_content);
+	  freeMap(&current_content);
 	  free(current_content);
 	  current_content=NULL;
Index: branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 900)
+++ branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 902)
@@ -107,5 +107,5 @@
 #endif
 
-#ifdef USE_HPC
+#ifdef USE_CALLBACK
 #include "service_json.h"
 #include "service_callback.h"
@@ -2489,5 +2489,5 @@
 	  recordServiceStatus(m);
 #endif
-#ifdef USE_HPC
+#ifdef USE_CALLBACK
 	  invokeCallback(m,NULL,NULL,0,0);
 #endif
@@ -2533,5 +2533,5 @@
 	  free(flenv);
 
-#ifdef USE_HPC
+#ifdef USE_CALLBACK
 	  invokeCallback(m,request_input_real_format,NULL,1,0);
 #endif
@@ -2550,5 +2550,5 @@
 #else
 	    recordResponse(m,fbkp1);
-#ifdef USE_HPC
+#ifdef USE_CALLBACK
 	    invokeCallback(m,NULL,NULL,7,0);
 #endif
@@ -2577,5 +2577,5 @@
 	  if(getMapFromMaps(m,"lenv","mapError")!=NULL){
 	    setMapInMaps(m,"lenv","message",_("Issue with geographic data"));
-#ifdef USE_HPC
+#ifdef USE_CALLBACK
 	    invokeCallback(m,NULL,NULL,7,0);
 #endif
@@ -2634,5 +2634,5 @@
     {
       if (eres == SERVICE_SUCCEEDED)
-#ifdef USE_HPC
+#ifdef USE_CALLBACK
 	invokeCallback(m,NULL,request_output_real_format,5,1);
 #endif
@@ -2665,5 +2665,5 @@
       recordResponse(m,fbkp1);
       if (eres == SERVICE_SUCCEEDED)
-#ifdef USE_HPC
+#ifdef USE_CALLBACK
 	invokeCallback(m,NULL,request_output_real_format,6,0);
 #endif
