Index: trunk/docs/services/howtos.rst
===================================================================
--- trunk/docs/services/howtos.rst	(revision 793)
+++ trunk/docs/services/howtos.rst	(revision 794)
@@ -6,6 +6,9 @@
 :ref:`services_index` are quite easy to create once you have installed the ZOO Kernel and have 
 chosen code (in the language of your choice) to turn into a ZOO service. Here are some 
-HelloWorlds in Python, PHP, Java  and JavaScript with links to their corresponding 
+HelloWorlds in Python, PHP, Java, C#  and JavaScript with links to their corresponding 
 ``.zcfg`` files.
+
+
+.. contents:: :depth: 3
 
 
@@ -199,5 +202,5 @@
 ----
 
-Specifically for the Java support, you may add the following two
+Specifically for the Java support, you may add the following three
 sections to your ``main.cfg`` file:
 
@@ -311,4 +314,85 @@
   }
 
+C#
+----
+
+Specifically for the C# support, you should add the following
+section to your ``main.cfg`` file.
+
+
+:[mono]:
+   This section is used to define both ``libPath`` and ``etcPath``
+   required by the Mono .NET Framework.
+
+ZOO-API
+*******
+
+Before you build your first ZOO-Service implemented in Mono, you
+should first build the ``ZMaps.dll`` containing the Mono ZOO-API.
+
+.. Note:: You should build ZOO-Kernel prior to follow this instructions.
+
+.. code-block:: guess
+
+  cd zoo-api/mono
+  make
+
+Then you should copy the ``ZMaps.dll`` in your ``servicePath`` or in
+the directory where your ``zoo_loader.cgi`` file is stored.
+
+The ZOO-API is available from a C# class named ZOO_API and provides
+the following static variables:
+
+:int SERVICE_SUCCEEDED:
+   Value to return in case your service end successfully.
+:int SERVICE_FAILED:
+   Value to retrun in case of failure.
+
+The ZOO-API provides the following static functions:
+
+:string Translate(String s):
+   This function call the internal ZOO-Kernel function responsible for
+   searching a translation of ``s`` in the zoo-services dictionary.
+
+:void UpdateStatus(ZMaps conf,String pourcent,String message):
+   This function call the updateStatus ZOO-Kernel function responsible
+   for updating the status of the running service (only usefull when
+   the service has been called asynchronously).
+
+
+C# ZCFG requirements
+**********************************
+
+.. Note:: For each Service provided by your ZOO Mono Services Provider
+          (your corresponding Mono class), the ZCFG File should have
+          the name of the Mono public static function corresponding to the
+          service (case-sensitive).
+
+The ZCFG file should contain the following :
+
+serviceType
+    Mono 
+serviceProvider
+    The full name of the C# dll containing the ZOO-Service Provider
+    (including ``.dll``).
+serviceNameSpace
+    The namespace of the C# class containing the ZOO-Service Provider.
+serviceClass
+    The name of the C# class containing the ZOO-Service Provider definition.
+
+C# Data Structure used
+********************************
+
+The three parameters of the function are passed to the Mono static
+function as ``ZMaps`` which are basically
+``Dictionary<String,_ZMaps>``.
+
+Sample ZOO C# Services Provider
+******************************************
+
+.. literalinclude:: ../../zoo-project/zoo-services/hello-mono/test.cs
+   :language: csharp
+   :lines: 24-100
+
 Javascript
 ----------
Index: trunk/workshop/index.rst
===================================================================
--- trunk/workshop/index.rst	(revision 793)
+++ trunk/workshop/index.rst	(revision 794)
@@ -12,4 +12,5 @@
    :maxdepth: 1
 
+   2016/index
    2015/index
    2014/index
Index: trunk/zoo-project/HISTORY.txt
===================================================================
--- trunk/zoo-project/HISTORY.txt	(revision 793)
+++ trunk/zoo-project/HISTORY.txt	(revision 794)
@@ -1,3 +1,4 @@
 Version 1.6.0-dev
+  * Add the C# as a supported programming language for Services 
   * Add nested inputs and outputs support (WPS 2.0.0)
   * Add servicePath special key to specify the service location
Index: trunk/zoo-project/zoo-api/mono/Makefile
===================================================================
--- trunk/zoo-project/zoo-api/mono/Makefile	(revision 794)
+++ trunk/zoo-project/zoo-api/mono/Makefile	(revision 794)
@@ -0,0 +1,7 @@
+all: ZMaps.dll
+
+ZMaps.dll: ZMaps.cs
+	mcs /target:library ZMaps.cs
+
+clean:
+	rm ZMaps.dll
Index: trunk/zoo-project/zoo-api/mono/ZMaps.cs
===================================================================
--- trunk/zoo-project/zoo-api/mono/ZMaps.cs	(revision 794)
+++ trunk/zoo-project/zoo-api/mono/ZMaps.cs	(revision 794)
@@ -0,0 +1,133 @@
+/*
+ * Author : Gérald FENOY
+ *
+ * Copyright (c) 2016 GeoLabs SARL
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+public static class ZOO_API{
+    public static int SERVICE_SUCCEEDED=3;
+    public static int SERVICE_FAILED=4;
+    [MethodImplAttribute(MethodImplOptions.InternalCall)]
+    extern public static string Translate(string str);
+    [MethodImplAttribute(MethodImplOptions.InternalCall)]
+    extern public static void UpdateStatus([In] ZooGenerics.ZMaps obj,string str,int p);
+};
+
+namespace ZooGenerics
+{
+    public class KeysList : List<String> { };
+    public class ZMap : Dictionary<String,String> {
+	public int getKeysCount(){
+	    List<String> tmp=new List<String>(this.Keys);
+	    return tmp.Count;
+	}
+	public String getKey(int i){
+	    List<String> tmp=new List<String>(this.Keys);
+	    return tmp[i];
+	}
+	public void addToMap(String name,String value){
+	    this.Add(name,value);
+	}
+	public String getMap(String name){
+	    String test;
+	    if(this.TryGetValue(name, out test)){
+		return test;
+	    }
+	    return null;
+	}
+	public byte[] getMapAsBytes(String name){
+	    String test;
+	    if(this.TryGetValue(name, out test)){
+		return System.Text.Encoding.UTF8.GetBytes(test);
+	    }
+	    return null;
+	}
+	public int getSize(){
+	    String test;
+	    if(this.TryGetValue("size", out test)){
+		return int.Parse(test);
+	    }
+	    return -1;
+	}
+    };
+    public class _ZMaps
+    {
+	private ZMap content; 
+	private Dictionary<string,_ZMaps> child;
+	public _ZMaps(){
+	    this.content=null;
+	    this.child=null;
+	}
+	public void setContent(ZMap content){
+	    this.content=content;
+	}
+	public void setChild(Dictionary<string,_ZMaps> content){
+	    this.child=content;
+	}
+	public void AddContent(String key,String value){
+	    this.content.Add(key,value);
+	}
+	public ZMap getContent(){
+	    return this.content;
+	}
+	public Dictionary<string,_ZMaps> getChild(){
+	    return this.child;
+	}
+    }
+    public class ZMaps : Dictionary<String,_ZMaps> {
+	public int getKeysCount(){
+	    List<String> tmp=new List<String>(this.Keys);
+	    return tmp.Count;
+	}
+	public String getKey(int i){
+	    List<String> tmp=new List<String>(this.Keys);
+	    return tmp[i];
+	}
+	public _ZMaps getValue(String key){
+	    return this[key];
+	}
+	public List<String> getKeys(){
+	    return new List<String>(this.Keys);
+	}
+	public void addToMaps(String name,_ZMaps content){
+	    this.Add(name,content);
+	}
+	public void setMapsInMaps(String mname,String name,String value){
+	    _ZMaps test;
+	    if (this.TryGetValue(mname, out test)) // Returns true.
+	    {
+		ZMap content=test.getContent();
+		content.addToMap(name,value);
+	    }
+	}
+	public _ZMaps getMaps(String name){
+	    _ZMaps test;
+	    if(this.TryGetValue(name, out test)){
+		return test;
+	    }
+	    return null;
+	}
+    };
+}
Index: trunk/zoo-project/zoo-kernel/Makefile.in
===================================================================
--- trunk/zoo-project/zoo-kernel/Makefile.in	(revision 793)
+++ trunk/zoo-project/zoo-kernel/Makefile.in	(revision 794)
@@ -86,4 +86,7 @@
 	gcc -fPIC ${XML2CFLAGS} ${JSCFLAGS} ${CFLAGS} ${JS_ENABLED} -c service_internal_js.c
 
+service_internal_mono.o: service_internal_mono.h service_internal_mono.c service.h
+	gcc -c ${XML2CFLAGS} ${MONO_CFLAGS} ${CFLAGS} ${MONO_ENABLED} service_internal_mono.c
+
 service_internal_ruby.o: service_internal_ruby.c service_internal_ruby.h
 	g++ ${XML2CFLAGS} ${RUBYCFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c service_internal_ruby.c
@@ -92,6 +95,6 @@
 	g++ -c ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} service_loader.c
 
-zoo_service_loader.o: zoo_service_loader.c service.h version.h ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE}
-	g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
+zoo_service_loader.o: zoo_service_loader.c service.h version.h ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE}
+	g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${MONO_CFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} ${MONO_ENABLED}  -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
 
 libzoo_service.${EXT}: version.h service_internal.o service.o sqlapi.o
@@ -100,5 +103,5 @@
 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}
 	g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS}  ${PERLCFLAGS} ${RUBYCFLAGS}  ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c  -fno-common -DPIC -o zoo_loader.o
-	g++  ${JSCFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o ${MS_FILE} ${PYTHON_FILE}  ${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} response_print.o server_internal.o caching.o request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi -L. ${LDFLAGS}
+	g++  ${JSCFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o ${MS_FILE} ${PYTHON_FILE}  ${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} response_print.o server_internal.o caching.o request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi -L. ${LDFLAGS}
 
 zcfg2yaml: zcfg2yaml.c service.h lex.sr.o service_conf.tab.o service_conf.y main_conf_read.tab.o lex.cr.o response_print.o server_internal.o service_internal.o ${MS_FILE} ${YAML_FILE}
Index: trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in
===================================================================
--- trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in	(revision 793)
+++ trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in	(revision 794)
@@ -96,6 +96,11 @@
 SAGA_FILE=@SAGA_FILE@
 
+MONO_CFLAGS=@MONO_CFLAGS@
+MONO_LDFLAGS=@MONO_LDFLAGS@
+MONO_ENABLED=@MONO_ENABLED@
+MONO_FILE=@MONO_FILE@
+
 CFLAGS=@RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
-LDFLAGS=-lzoo_service @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS}  ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS}
+LDFLAGS=-lzoo_service @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS}  ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS}
 
 DATAROOTDIR=@datarootdir@/zoo-project
Index: trunk/zoo-project/zoo-kernel/configure.ac
===================================================================
--- trunk/zoo-project/zoo-kernel/configure.ac	(revision 793)
+++ trunk/zoo-project/zoo-kernel/configure.ac	(revision 794)
@@ -637,4 +637,51 @@
 
 # ===========================================================================
+# Detect if mono is installed
+# ===========================================================================
+
+AC_ARG_WITH([mono], 
+	[AS_HELP_STRING([--with-mono=PATH], [To enable mono support, specify the path to find pkg-config,  disabled by default])], 
+	[MONOHOME="$withval"; MONO_ENABLED="-DUSE_MONO"], [MONO_ENABLED=""])
+
+if test -z "$MONO_ENABLED"
+then
+	MONO_FILE=""
+else
+	MONO_FILE="service_internal_mono.o"
+	if test "x$MONOHOME" = "x"; 
+	then
+		MONOHOME="/usr"
+	fi
+	if test "x$MONOHOME" = "xyes"; 
+	then
+		MONOHOME="/usr"
+	fi
+
+	# Extract the linker and include flags
+	MONO_CFLAGS=`$MONOHOME/bin/pkg-config --cflags mono-2`
+	MONO_LDFLAGS=`$MONOHOME/bin/pkg-config --libs mono-2`
+
+	AC_LANG([C++])
+	echo $JAVA_CPPFLAGS
+	# Check headers file (second time we check that in fact)
+	CPPFLAGS_SAVE="$CFLAGS"
+	CPPFLAGS="$MONO_CFLAGS"
+	AC_CHECK_HEADERS([mono/jit/jit.h],
+			 [], [AC_MSG_ERROR([could not find jit.h file])])
+	CPPFLAGS="$CPPFLAGS_SAVE"
+	# Ensure we can link against libmono-2.0
+	LIBS_SAVE="$LIBS"
+	LIBS="$MONO_LDFLAGS"
+	AC_CHECK_LIB([mono-2.0], [mono_runtime_invoke], [], [AC_MSG_ERROR([could not find libmono])], [])
+	LIBS="$LIBS_SAVE"
+
+	AC_SUBST([MONO_CFLAGS])
+	AC_SUBST([MONO_LDFLAGS])
+fi 
+
+AC_SUBST([MONO_ENABLED])
+AC_SUBST([MONO_FILE])
+
+# ===========================================================================
 # Detect if ruby is installed
 # ===========================================================================
Index: trunk/zoo-project/zoo-kernel/request_parser.c
===================================================================
--- trunk/zoo-project/zoo-kernel/request_parser.c	(revision 793)
+++ trunk/zoo-project/zoo-kernel/request_parser.c	(revision 794)
@@ -1627,6 +1627,6 @@
               cgiFilePtr file;
               int targetFile;
-              char storageNameOnServer[2048];
-              char fileNameOnServer[64];
+              char *storageNameOnServer;
+              char *fileNameOnServer;
               char contentType[1024];
               char buffer[1024];
@@ -1651,6 +1651,8 @@
                         break;
                     }
+		  fileNameOnServer=(char*)malloc((strlen(name) - t - 1 )*sizeof(char));
                   strcpy (fileNameOnServer, name + t + 1);
 
+		  storageNameOnServer=(char*)malloc((strlen(path->value) + strlen(fileNameOnServer) + 2)*sizeof(char));
                   sprintf (storageNameOnServer, "%s/%s", path->value,
                            fileNameOnServer);
@@ -1683,4 +1685,6 @@
                   cgiFormFileClose (file);
                   close (targetFile);
+		  free(fileNameOnServer);
+		  free(storageNameOnServer);
 #ifdef DEBUG
                   fprintf (stderr, "File \"%s\" has been uploaded",
Index: trunk/zoo-project/zoo-kernel/service.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service.c	(revision 793)
+++ trunk/zoo-project/zoo-kernel/service.c	(revision 794)
@@ -515,5 +515,6 @@
     free(tmp->value);
   tmp->value=(char*)malloc((size+1)*sizeof(char));
-  memmove(tmp->value,v,size*sizeof(char));
+  if(v!=NULL)
+    memmove(tmp->value,v,size*sizeof(char));
   tmp->value[size]=0;
   char sin[128];
Index: trunk/zoo-project/zoo-kernel/service_internal_mono.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_mono.c	(revision 794)
+++ trunk/zoo-project/zoo-kernel/service_internal_mono.c	(revision 794)
@@ -0,0 +1,377 @@
+/*
+ * Author : Gérald FENOY
+ * 
+ * ref. http://www.mono-project.com/docs/advanced/embedding/
+ *      http://www.mono-project.com/docs/advanced/pinvoke/
+ *      http://www.giorgosdimtsas.net/embedding-mono-in-your-c-application/
+ *
+ * Copyright (c) 2009-2013 GeoLabs SARL
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "service_internal_mono.h"
+#include "response_print.h"
+
+/**
+ * Load a Mono dll then run the static public method corresponding to the 
+ * service by passing the conf, inputs and outputs parameters.
+ *
+ * @param main_conf the conf maps containing the main.cfg settings
+ * @param request the map containing the HTTP request
+ * @param s the service structure
+ * @param real_inputs the maps containing the inputs
+ * @param real_outputs the maps containing the outputs
+ */
+int zoo_mono_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){
+  maps* m=*main_conf;
+  maps* inputs=*real_inputs;
+  maps* outputs=*real_outputs;
+  char *ntmp=NULL;
+  map* tmp=getMap(request,"metapath");
+  char *classpath;
+  char *oclasspath;
+  int res=SERVICE_FAILED;
+  MonoAssembly* assembly;
+  MonoImage* monoImage;
+
+  char* libPath="/usr/lib";
+  char* etcPath="/etc";
+  map* libPathMap=getMapFromMaps(*main_conf,"mono","lib");
+  map* etcPathMap=getMapFromMaps(*main_conf,"mono","etc");
+  if(libPathMap!=NULL)
+    libPath=libPathMap->value;
+  if(etcPathMap!=NULL)
+    etcPath=etcPathMap->value;
+  
+  mono_set_dirs(libPath,etcPath);
+
+  map* configMap=getMapFromMaps(*main_conf,"mono","config");
+  if(configMap!=NULL)
+    mono_config_parse(configMap->value);
+  else
+    mono_config_parse(NULL);
+
+  MonoDomain* monoDomain = mono_jit_init_version("ZOO_Embedded_Domain",
+                                                 "v4.0.30319");
+
+  map* cwdMap=getMapFromMaps(*main_conf,"main","servicePath");
+  if(cwdMap==NULL)
+    cwdMap=getMapFromMaps(*main_conf,"lenv","cwd");
+  
+  char *zooAssembly=(char*)malloc((strlen(cwdMap->value)+11)*sizeof(char));
+  sprintf(zooAssembly,"%s/ZMaps.dll",cwdMap->value);
+  assembly = mono_domain_assembly_open(monoDomain,zooAssembly);
+  if(assembly==NULL){
+    setMapInMaps(*main_conf,"lenv","message",_("The ZMaps.dll assembly cannot be found!"));
+    return 4;
+  }
+  mono_add_internal_call ("ZOO_API::Translate", MonoTranslate);
+  mono_add_internal_call ("ZOO_API::UpdateStatus", MonoUpdateStatus);
+
+  monoImage = mono_assembly_get_image(assembly);
+  MonoClass *KeysList = mono_class_from_name(monoImage, "ZooGenerics", "KeysList");
+  MonoClass *ZMapsClass = mono_class_from_name(monoImage, "ZooGenerics", "ZMaps");
+  MonoMethod *ZMapsAdd = mono_class_get_method_from_name(ZMapsClass, "addToMaps", 2);  
+  MonoMethod *ZMapsGetMaps = mono_class_get_method_from_name(ZMapsClass, "getMaps", 1);
+  MonoClass *_ZMapsClass = mono_class_from_name(monoImage, "ZooGenerics", "_ZMaps");
+  MonoMethod *_ZMapsSetContent = mono_class_get_method_from_name(_ZMapsClass, "setContent", 1);
+  MonoMethod *_ZMapsSetChild = mono_class_get_method_from_name(_ZMapsClass, "setChild", 1);
+  MonoMethod *_ZMapsGetContent = mono_class_get_method_from_name(_ZMapsClass, "getContent", 0);
+  MonoMethod *_ZMapsGetChild = mono_class_get_method_from_name(_ZMapsClass, "getChild", 0);
+  MonoClass *ZMapClass = mono_class_from_name(monoImage, "ZooGenerics", "ZMap");
+  MonoMethod *ZMapGetMap = mono_class_get_method_from_name(ZMapClass, "getMap", 1);
+  MonoMethod *ZMapAdd = mono_class_get_method_from_name(ZMapClass, "addToMap", 2);
+  MonoMethod *ZMapDisplay = mono_class_get_method_from_name(ZMapClass, "display", 1);
+  MonoObject *exc=NULL;
+
+  MonoClass *classes[3]={_ZMapsClass,ZMapsClass,ZMapClass};
+  MonoMethod *methods[5]={ZMapsAdd,_ZMapsSetContent,_ZMapsSetChild,ZMapAdd,ZMapDisplay};
+
+  MonoMethod *ZMapsGetKeys = mono_class_get_method_from_name(ZMapsClass, "getKeys", 0);
+  MonoMethod *ZMapsGetKeysCount = mono_class_get_method_from_name(ZMapsClass, "getKeysCount", 0);
+  MonoMethod *ZMapsGetKey = mono_class_get_method_from_name(ZMapsClass, "getKey", 1);
+  MonoMethod *ZMapGetKeys = mono_class_get_method_from_name(ZMapClass, "getKeys", 0);
+  MonoClassField *ZMapKeys = mono_class_get_field_from_name(ZMapClass, "Keys");
+  MonoMethod *ZMapGetKeysCount = mono_class_get_method_from_name(ZMapClass, "getKeysCount", 0);
+  MonoMethod *ZMapGetKey = mono_class_get_method_from_name(ZMapClass, "getKey", 1);
+  MonoMethod *ZMapGetSize = mono_class_get_method_from_name(ZMapClass, "getSize", 0);
+  MonoMethod *ZMapGetMapAsBytes = mono_class_get_method_from_name(ZMapClass, "getMapAsBytes", 0);
+  MonoClass *oclasses[4]={_ZMapsClass,ZMapsClass,ZMapClass,KeysList};
+  MonoMethod *omethods[10]={ZMapsGetMaps,ZMapsGetKeysCount,ZMapsGetKey,ZMapGetMap,ZMapGetKeysCount,ZMapGetKey,_ZMapsGetContent,_ZMapsGetChild,ZMapGetSize,ZMapGetMapAsBytes};
+
+  for(int i=0;i<4;i++){
+    iclasses[i]=oclasses[i];
+    imethods[i]=omethods[i];
+  }
+  for(int i=4;i<10;i++)
+    imethods[i]=omethods[i];
+
+  void *args[3];
+
+  MonoObject * main=ZMapsFromMaps(monoDomain,classes,methods,&exc,m);
+
+  MonoObject * in=ZMapsFromMaps(monoDomain,classes,methods,&exc,inputs);
+
+  MonoObject * out=ZMapsFromMaps(monoDomain,classes,methods,&exc,outputs);
+
+  args [0] = main;
+  args [1] = in;
+  args [2] = out;
+
+  tmp=getMap(s->content,"serviceProvider");
+  char *sName=(char*)malloc((strlen(tmp->value)+strlen(cwdMap->value)+2)*sizeof(char));
+  sprintf(sName,"%s/%s",cwdMap->value,tmp->value);
+  MonoAssembly* serviceAssembly = mono_domain_assembly_open(monoDomain,sName);
+  if(serviceAssembly==NULL){
+    char *msg=(char*)malloc((strlen(_("Your service assembly: %s cannot be found!"))+strlen(tmp->value)+1)*sizeof(char));
+    sprintf(msg,_("Your service assembly %s cannot be found!"),tmp->value);
+    setMapInMaps(*main_conf,"lenv","message",msg);
+    free(msg);
+    return 4;
+  }
+
+  MonoImage* serviceImage = mono_assembly_get_image(serviceAssembly);
+
+  map* tmp1=getMap(s->content,"serviceNameSpace");
+  tmp=getMap(s->content,"serviceClass");
+  MonoClass *serviceClass = mono_class_from_name(serviceImage, tmp1->value, tmp->value);
+  if(serviceClass==NULL){
+    char *msg=(char*)malloc((strlen(_("Your service class method %s::%s cannot be found!"))+strlen(tmp1->value)+strlen(tmp->value)+1)*sizeof(char));
+    sprintf(msg,_("Your service class method %s::%s cannot be found!"),tmp1->value,tmp->value);
+    setMapInMaps(*main_conf,"lenv","message",msg);
+    free(msg);
+    return 4;
+  }
+  MonoMethod *serviceFunction = mono_class_get_method_from_name(serviceClass, s->name, 3);
+  if(serviceFunction==NULL){
+    char *msg=(char*)malloc((strlen(_("Your service static method %s cannot be found!"))+strlen(s->name)+1)*sizeof(char));
+    sprintf(msg,_("Your service static method %s cannot be found!"),s->name);
+    setMapInMaps(*main_conf,"lenv","message",msg);
+    free(msg);
+    return 4;
+  }
+  MonoObject *exception=NULL;
+  MonoObject *result = mono_runtime_invoke(serviceFunction,NULL,args,&exception);
+  res=*(int*)mono_object_unbox (result);
+  if(res==3){
+    freeMaps(&outputs);
+    free(outputs);
+    outputs=mapsFromZMaps(monoDomain,oclasses,omethods,args[2]);
+    *real_outputs=outputs;
+  }
+  freeMaps(&m);
+  free(m);
+  m=mapsFromZMaps(monoDomain,oclasses,omethods,args[0]);
+  *main_conf=m;
+  mono_jit_cleanup (monoDomain);
+  return res;
+}
+
+/**
+ * Create ZMaps from maps
+ * @param domain the Mono Domain
+ * @param classes the Mono classes required to create (_ZMaps,ZMaps and ZMap)
+ * @param methods the Mono methods required (ZMapsAdd, _ZMapsSetContent, _ZMapsSetChild, ZMapAdd and ZMapDisplay)
+ * @param m the maps to use as source to create the corresponding ZMaps
+ * @return MonoObject* to a new ZMap
+ */
+MonoObject* ZMapsFromMaps(MonoDomain* domain,MonoClass **classes,MonoMethod **methods,MonoObject **exc,maps* m){
+  MonoObject *res=mono_object_new(domain,classes[1]);
+  MonoMethod* constructorMethod = mono_class_get_method_from_name(classes[1],
+								  ".ctor",
+								  0);
+  mono_runtime_invoke(constructorMethod, res, NULL, exc);
+  MonoMethod* constructorMethod1 = mono_class_get_method_from_name(classes[0],
+								   ".ctor",
+								   0);
+  
+  while(m!=NULL){
+    MonoObject *tmpRes=mono_object_new(domain,classes[0]);
+    mono_runtime_invoke(constructorMethod1, tmpRes, NULL, exc);
+    void *values0 [1];
+    MonoObject* content = ZMapFromMap (domain,classes[2],methods,exc,m->content);
+    values0 [0] = content;
+    MonoObject *exception=NULL;
+    mono_runtime_invoke(methods[1],tmpRes,values0,&exception);
+    if(exception!=NULL)
+      {
+	fprintf(stderr,"ERROR : %s\n", mono_string_to_utf8(mono_object_to_string(exception, NULL)));
+	fflush(stderr);
+	return res;
+      }
+    if(m->child!=NULL){
+      void *values [1];
+      values [0] = ZMapsFromMaps (domain,classes,methods,exc,m->child);
+      mono_runtime_invoke(methods[2],tmpRes,values,exc);
+    }
+    void *values [2];
+    values [0] = mono_string_new (domain, m->name);
+    values [1] = tmpRes;
+    mono_runtime_invoke(methods[0],res,values,exc);
+    m=m->next;
+  }
+  return res;
+}
+
+/**
+ * Create ZMap from map
+ * @param domain the Mono Domain
+ * @param classes the Mono classes required to create (_ZMaps,ZMaps and ZMap)
+ * @param methods the Mono methods required (ZMapsAdd, _ZMapsSetContent, _ZMapsSetChild, ZMapAdd and ZMapDisplay)
+ * @param exc the Mono exception object
+ * @param m the map to use as source to create a new ZMap
+ * @return MonoObject* to a new ZMap
+ */
+MonoObject* ZMapFromMap(MonoDomain* domain,MonoClass *ZMapClass,MonoMethod **methods,MonoObject **exc,map* m){
+  MonoObject *res=mono_object_new(domain,ZMapClass);
+  MonoMethod* constructorMethod = mono_class_get_method_from_name(ZMapClass,
+								  ".ctor",
+								  0);
+  mono_runtime_invoke(constructorMethod, res, NULL, exc);
+  map* sizeMap=getMap(m,"size");
+  while(m!=NULL){
+    void *values [2];
+    MonoString* name = mono_string_new(domain, m->name);
+    MonoString* value;
+    if(sizeMap!=NULL && strcasecmp(m->name,"value")==0)
+      value = mono_string_new_len(domain, m->value,atoi(sizeMap->value));
+    else
+      value = mono_string_new(domain, m->value);
+    values [0] = name;
+    values [1] = value;
+    mono_runtime_invoke(methods[3],res,values,exc);
+    m=m->next;
+  }
+  return res;
+}
+
+/**
+ * Create maps from ZMaps
+ * @param domain the Mono Domain
+ * @param classes the Mono classes required to create (_ZMapsClass,ZMapsClass,ZMapClass,KeysList)
+ * @param methods the Mono methods required (ZMapsGetMaps,ZMapsGetKeysCount,ZMapsGetKey,ZMapGetMap,ZMapGetKeysCount,ZMapGetKey,_ZMapsGetContent,_ZMapsGetChild)
+ * @param m the ZMaps to use as source to create a new maps
+ * @return MonoObject* to a new ZMaps
+ */
+maps* mapsFromZMaps(MonoDomain* domain,MonoClass **classes,MonoMethod **methods,MonoObject* m){
+  maps* res=NULL;
+  if(m!=NULL){
+    MonoObject *exc=NULL;
+    MonoObject *okeys = mono_runtime_invoke(methods[1],m,NULL,&exc);
+    if(exc!=NULL)
+      {
+	fprintf(stderr,"ERROR : %s\n", mono_string_to_utf8(mono_object_to_string(exc, NULL)));
+	fflush(stderr);
+	return res;
+      }
+
+    int keyCount=*(int*)mono_object_unbox (okeys);
+    for(int i=0;i<keyCount;i++){
+      void* values[1];
+      values[0]=&i;
+      exc=NULL;
+      MonoObject *okey = (MonoString*) mono_runtime_invoke(methods[2],m,values,&exc);
+      char* key = mono_string_to_utf8(okey);
+      maps* tmp=createMaps(key);
+      values[0]=mono_string_new (domain, key);
+      MonoObject *content_ZMaps = (MonoString*) mono_runtime_invoke(methods[0],m,values,&exc);
+      MonoObject *content = mono_runtime_invoke(methods[6],content_ZMaps,NULL,&exc);
+      tmp->content=mapFromZMap(domain,classes,methods,content);
+      MonoObject *childs = mono_runtime_invoke(methods[7],content_ZMaps,NULL,&exc);
+      tmp->child=mapsFromZMaps(domain,classes,methods,childs);
+      if(res==NULL){
+	res=dupMaps(&tmp);
+      }else
+	addMapsToMaps(&res,tmp);
+      freeMaps(&tmp);
+      free(tmp);
+      mono_free(key);
+    }
+  }
+  return res;
+}
+
+/**
+ * Create map from ZMap
+ * @param domain the Mono Domain
+ * @param classes the Mono classes required (_ZMapsClass,ZMapsClass,ZMapClass,KeysList)
+ * @param methods the Mono methods required (ZMapsGetMaps,ZMapsGetKeysCount,ZMapsGetKey,ZMapGetMap,ZMapGetKeysCount,ZMapGetKey,_ZMapsGetContent,_ZMapsGetChild,ZMapGetSize)
+ * @param m the ZMap to use as source to create a new map
+ * @return MonoObject* to a new ZMap
+ */
+map* mapFromZMap(MonoDomain* domain,MonoClass **classes,MonoMethod **methods,MonoObject* m){
+  map* res=NULL;
+  if(m!=NULL){
+    MonoObject *exc = NULL;
+    MonoObject *okeys = mono_runtime_invoke(methods[4],m,NULL,&exc);
+    int keyCount=*(int*)mono_object_unbox (okeys);
+    MonoObject *osize = mono_runtime_invoke(methods[8],m,NULL,&exc);
+    int size=*(int*)mono_object_unbox (osize);
+    for(int i=0;i<keyCount;i++){
+      void* values[1];
+      values[0]=&i;
+      exc=NULL;
+      MonoObject *okey = (MonoString*) mono_runtime_invoke(methods[5],m,values,&exc);
+      char* key = mono_string_to_utf8(okey);
+      values[0]=mono_string_new (domain, key);
+      exc=NULL;
+      MonoObject *ovalue = (MonoString*) mono_runtime_invoke(methods[3],m,values,&exc);
+      char* value = mono_string_to_utf8(ovalue);
+      if(res==NULL)
+	res=createMap(key,value);
+      else
+	addToMap(res,key,value);
+    }
+  }
+  return res;
+}
+
+/**
+ * The translate function to search in zoo-services gettext domain for translating a string.
+ * @param str the string to be translated
+ * @return the translated string
+ */
+static MonoString* MonoTranslate(MonoString *str){
+  return mono_string_new (mono_domain_get(), mono_string_to_utf8(_(str)));
+}
+
+/**
+ * The updateStatus function to update the ongoing status of a ZOO-Service.
+ * @param m the main.cfg map
+ * @param str the message for the current step 
+ * @param p the percentage of the 
+ * @return the translated string
+ */
+static void MonoUpdateStatus(MonoObject* obj,MonoString *str,int* p){
+  MonoDomain* domain = mono_object_get_domain (obj);
+  maps *confMaps=mapsFromZMaps(domain,iclasses,imethods,obj);
+  setMapInMaps(confMaps,"lenv","message",mono_string_to_utf8(str));
+  int tmp=p;
+  if (p < 0 || p > 100){
+    tmp=-1;
+  }
+  char tmpStatus[5];
+  snprintf(tmpStatus, 4, "%d", tmp);
+  setMapInMaps(confMaps,"lenv","status",(char*)tmpStatus);
+  _updateStatus(confMaps);
+  freeMaps(&confMaps);
+  free(confMaps);
+  return;
+}
Index: trunk/zoo-project/zoo-kernel/service_internal_mono.h
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_mono.h	(revision 794)
+++ trunk/zoo-project/zoo-kernel/service_internal_mono.h	(revision 794)
@@ -0,0 +1,54 @@
+/*
+ * Author : Gérald FENOY
+ *
+ * Copyright (c) 2009-2010 GeoLabs SARL
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef ZOO_SERVICE_INTERNAL_CSHARP_H
+#define ZOO_SERVICE_INTERNAL_CSHARP_H 1
+
+#pragma once 
+
+#include "service.h"
+#include "service_internal.h"
+#include <mono/jit/jit.h>
+#include <mono/metadata/mono-config.h>
+#include <mono/metadata/assembly.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  int zoo_mono_support(maps**,map*,service*,maps**,maps**);
+  MonoObject* ZMapsFromMaps(MonoDomain*,MonoClass**,MonoMethod**,MonoObject**,maps*);
+  MonoObject* ZMapFromMap(MonoDomain*,MonoClass*,MonoMethod**,MonoObject**,map*);
+  maps* mapsFromZMaps(MonoDomain*,MonoClass**,MonoMethod**,MonoObject*);
+  map* mapFromZMap(MonoDomain*,MonoClass**,MonoMethod**,MonoObject*);
+  static MonoString* MonoTranslate(MonoString*);
+  static void MonoUpdateStatus(MonoObject*,MonoString*,int*);
+  MonoClass *iclasses[4];
+  MonoMethod *imethods[10];
+
+#ifdef __cplusplus
+}
+#endif
+#endif
Index: trunk/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 793)
+++ trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 794)
@@ -81,4 +81,8 @@
 #ifdef USE_PERL
 #include "service_internal_perl.h"
+#endif
+
+#ifdef USE_MONO
+#include "service_internal_mono.h"
 #endif
 
@@ -705,4 +709,14 @@
       *eres =
         zoo_ruby_support (&m, request_inputs, s1, &request_input_real_format,
+                          &request_output_real_format);
+    }
+  else
+#endif
+
+#ifdef USE_MONO
+  if (strncasecmp (r_inputs->value, "Mono", 4) == 0)
+    {
+      *eres =
+        zoo_mono_support (&m, request_inputs, s1, &request_input_real_format,
                           &request_output_real_format);
     }
Index: trunk/zoo-project/zoo-services/hello-mono/Makefile
===================================================================
--- trunk/zoo-project/zoo-services/hello-mono/Makefile	(revision 794)
+++ trunk/zoo-project/zoo-services/hello-mono/Makefile	(revision 794)
@@ -0,0 +1,7 @@
+all: cgi-env/TestService.dll
+
+cgi-env/TestService.dll: test.cs
+	mcs /target:library -r:../../zoo-api/mono/ZMaps.dll -out:cgi-env/TestService.dll test.cs 
+
+clean: 
+	rm -rf cgi-env/*dll
Index: trunk/zoo-project/zoo-services/hello-mono/cgi-env/HelloMono.zcfg
===================================================================
--- trunk/zoo-project/zoo-services/hello-mono/cgi-env/HelloMono.zcfg	(revision 794)
+++ trunk/zoo-project/zoo-services/hello-mono/cgi-env/HelloMono.zcfg	(revision 794)
@@ -0,0 +1,43 @@
+[HelloMono]
+ Title = Create a welcome message string.
+ Abstract = Create a welcome string.
+ processVersion = 2
+ storeSupported = true
+ statusSupported = true
+ serviceProvider = TestService.dll
+ serviceNameSpace = Default
+ serviceClass = Service
+ serviceType = Mono
+ <DataInputs>
+  [a]
+   Title = Input string
+   Abstract = The name to display in the welcome message.
+   minOccurs = 1
+   maxOccurs = 1
+   <LiteralData>
+    dataType = int
+    <Default>
+    AllowedValues = 101,202,303,404
+    rangeMin = -100
+    rangeMax = 100
+    rangeSpacing = 1
+    rangeClosure = co
+      value = 11
+    </Default>
+    <Supported>
+    	AllowedValues = 405,502,503,504
+    </Supported>
+    <Supported>
+    	AllowedValues = 540,502,603,604
+    </Supported>
+   </LiteralData>
+ </DataInputs>
+ <DataOutputs>
+  [Result]
+   Title = The welcome message
+   Abstract = The welcome message created by service.
+   <LiteralData>
+    DataType = string
+    <Default />
+   </LiteralData>
+ </DataOutputs>
Index: trunk/zoo-project/zoo-services/hello-mono/cgi-env/longProcessMono.zcfg
===================================================================
--- trunk/zoo-project/zoo-services/hello-mono/cgi-env/longProcessMono.zcfg	(revision 794)
+++ trunk/zoo-project/zoo-services/hello-mono/cgi-env/longProcessMono.zcfg	(revision 794)
@@ -0,0 +1,43 @@
+[longProcessMono]
+ Title = Create a welcome message string.
+ Abstract = Create a welcome string.
+ processVersion = 2
+ storeSupported = true
+ statusSupported = true
+ serviceProvider = TestService.dll
+ serviceNameSpace = Default
+ serviceClass = Service
+ serviceType = Mono
+ <DataInputs>
+  [a]
+   Title = Input string
+   Abstract = The name to display in the welcome message.
+   minOccurs = 1
+   maxOccurs = 1
+   <LiteralData>
+    dataType = int
+    <Default>
+    AllowedValues = 101,202,303,404
+    rangeMin = -100
+    rangeMax = 100
+    rangeSpacing = 1
+    rangeClosure = co
+      value = 11
+    </Default>
+    <Supported>
+    	AllowedValues = 405,502,503,504
+    </Supported>
+    <Supported>
+    	AllowedValues = 540,502,603,604
+    </Supported>
+   </LiteralData>
+ </DataInputs>
+ <DataOutputs>
+  [Result]
+   Title = The welcome message
+   Abstract = The welcome message created by service.
+   <LiteralData>
+    DataType = string
+    <Default />
+   </LiteralData>
+ </DataOutputs>
Index: trunk/zoo-project/zoo-services/hello-mono/test.cs
===================================================================
--- trunk/zoo-project/zoo-services/hello-mono/test.cs	(revision 794)
+++ trunk/zoo-project/zoo-services/hello-mono/test.cs	(revision 794)
@@ -0,0 +1,66 @@
+/*
+ * Author : Gérald FENOY
+ *
+ * Copyright (c) 2016 GeoLabs SARL
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+using System;
+using ZooGenerics;
+using System.Threading;
+
+namespace Default
+{
+    public class Service{
+	public static int HelloMono(ZMaps conf,ZMaps inputs,ZMaps outputs){
+	    _ZMaps test;
+	    if(inputs.TryGetValue("a", out test)){
+		ZMap content=test.getContent();
+		String test1;
+		if(content.TryGetValue("value", out test1)){
+		    outputs.setMapsInMaps("Result","value",ZOO_API.Translate("Hello ")+test1+" from the Mono .NET framework World!");
+		}
+		return ZOO_API.SERVICE_SUCCEEDED;
+	    }else{
+		conf.setMapsInMaps("lenv","message","Unable to run the service");
+		return ZOO_API.SERVICE_FAILED;
+	    }
+	}
+	public static int longProcessMono(ZMaps conf,ZMaps inputs,ZMaps outputs){
+	    _ZMaps test;
+	    int i=1;
+	    while(i<10){
+		ZOO_API.UpdateStatus(conf,"Step "+i,(i*10));
+		Thread.Sleep(1000);
+		i+=1;
+	    }
+	    if(inputs.TryGetValue("a", out test)){
+		ZMap content=test.getContent();
+		String test1;
+		if(content.TryGetValue("value", out test1)){
+		    outputs.setMapsInMaps("Result","value",ZOO_API.Translate("Hello ")+test1+" from the Mono .NET framework World!");
+		}
+		return ZOO_API.SERVICE_SUCCEEDED;
+	    }else{
+		conf.setMapsInMaps("lenv","message","Unable to run the service");
+		return ZOO_API.SERVICE_FAILED;
+	    }
+	}
+    };
+}
