Index: /trunk/docs/services/zcfg-reference.txt
===================================================================
--- /trunk/docs/services/zcfg-reference.txt	(revision 458)
+++ /trunk/docs/services/zcfg-reference.txt	(revision 459)
@@ -131,4 +131,8 @@
 A ``<LiteralData>`` node contains:
 
+- one (optional) ``AllowedValues`` key containing all value allowed for this input
+- one (optional) ``rangeMin`` (``rangeMin``) properties containing the minimum (maximum) value of this range
+- one (optional) ``rangeSpacing`` properties containing the regular distance or spacing between value in this range
+- one (optional) ``rangeClosure`` properties containing the closure type (``c``,``o``,``oc``,``co``)
 - one ``<Default>`` node,
 - zero or more ``<Supported>`` nodes depending on the existence or the number of supported Units Of Measure (UOM), and 
@@ -159,4 +163,33 @@
    </LiteralData>
 
+
+A typical ``<LiteralData>`` node, defining a ``float`` data type which
+should take values contained in ``[0.0,100.0]``, looks like the following:
+.. code-block:: guess
+   :linenos:
+   
+   <LiteralData>
+     dataType = float
+     rangeMin = 0.0
+     rangeMax = 100.0
+     rangeClosure = c
+     <Default />
+   </LiteralData>
+
+A typical ``<LiteralData>`` node, defining a ``string`` data type which
+support values ``hillshade``, ``slope``, ``aspect``, ``TRI``, ``TPI``
+and ``roughness``, looks like the following:
+.. code-block:: guess
+   :linenos:
+   
+   <LiteralData>
+     dataType = float
+     AllowedValues = hillshade,slope,aspect,TRI,TPI,roughness
+     <Default />
+   </LiteralData>
+
+Properties``AllowedValues`` and ``range*`` can be conbined with both ``<Default>`` and
+``<Supported>`` nodes in the same ``<LiteralData>`` node.
+
 .. _BoundingBoxData:
 
Index: /trunk/zoo-project/zoo-kernel/Makefile.in
===================================================================
--- /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 458)
+++ /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 459)
@@ -1,2 +1,4 @@
+include ZOOMakefile.opts
+
 OS:=$(shell uname -s)
 ifeq ($(OS),Darwin)
@@ -10,8 +12,4 @@
 JAVA_FILE=@JAVA_FILE@
 
-MS_CFLAGS=@MS_CFLAGS@
-MS_LDFLAGS=@MS_LIBS@
-MS_FILE=@MS_FILE@
-
 CFLAGS=-fpic ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
 LDFLAGS=-lcurl -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MS_LDFLAGS} ${MACOS_LD_FLAGS}
@@ -22,20 +20,4 @@
 PHP_FILE=@PHP_FILE@
 
-
-PYTHONCFLAGS=@PYTHON_CPPFLAGS@
-PYTHONLDFLAGS=@PYTHON_LDFLAGS@
-PYTHON_ENABLED=@PYTHON_ENABLED@
-PYTHON_FILE=@PYTHON_FILE@
-
-JSCFLAGS=@JS_CPPFLAGS@
-JSLDFLAGS=@JS_LDFLAGS@
-JS_ENABLED=@JS_ENABLED@
-JS_FILE=@JS_FILE@
-
-XML2CFLAGS=@XML2_CPPFLAGS@
-XML2LDFLAGS=@XML2_LDFLAGS@
-
-GDAL_CFLAGS=@GDAL_CFLAGS@
-GDAL_LIBS=@GDAL_LIBS@
 
 PERLCFLAGS=@PERL_CPPFLAGS@
@@ -89,5 +71,4 @@
 	gcc -c ${XML2CFLAGS} ${PERLCFLAGS} ${CFLAGS}  ${PERL_ENABLED} service_internal_perl.c
 
-
 service_internal_java.o: service_internal_java.c service.h
 	gcc -c ${XML2CFLAGS} ${JAVACFLAGS} ${CFLAGS} ${JAVA_ENABLED} service_internal_java.c
@@ -96,4 +77,6 @@
 	gcc ${XML2CFLAGS} ${JSCFLAGS} ${CFLAGS} ${JS_ENABLED} -c service_internal_js.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
 
 service_loader.o: service_loader.c service.h
@@ -103,6 +86,6 @@
 	g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
 
-zoo_loader.cgi: 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 service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE}
-	g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS}  ${PERLCFLAGS}   ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c  -fno-common -DPIC -o zoo_loader.o
+zoo_loader.cgi: 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 service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_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} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o service_internal.o ${MS_FILE} ${PYTHON_FILE}  ${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi ${LDFLAGS}
 
Index: /trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in
===================================================================
--- /trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in	(revision 458)
+++ /trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in	(revision 459)
@@ -14,12 +14,24 @@
 PYTHONCFLAGS=@PYTHON_CPPFLAGS@
 PYTHONLDFLAGS=@PYTHON_LDFLAGS@
+PYTHON_ENABLED=@PYTHON_ENABLED@
+PYTHON_FILE=@PYTHON_FILE@
+
+RUBYCFLAGS=@RUBY_CPPFLAGS@
+RUBYLDFLAGS=@RUBY_LDFLAGS@
+RUBY_ENABLED=@RUBY_ENABLED@
+RUBY_FILE=@RUBY_FILE@
 
 JS_ENABLED=@JS_ENABLED@
 JSCFLAGS=@JS_CPPFLAGS@
 JSLDFLAGS=@JS_LDFLAGS@
+JS_FILE=@JS_FILE@
 ifeq ($(JS_ENABLED),-DUSE_JS)
      JS_LDFLAGS=${ZRPATH}/zoo-kernel/ulinet.o ${ZRPATH}/zoo-kernel/service_internal_js.o -lcurl 
 endif
 
+MS_CFLAGS=@MS_CFLAGS@
+MS_LDFLAGS=@MS_LIBS@
+MS_FILE=@MS_FILE@
+
 ZOO_CFLAGS=-I${ZRPATH}/../thirds/cgic206/ -I${ZRPATH}/zoo-kernel/
 ZOO_LDFLAGS=-lcrypto
Index: /trunk/zoo-project/zoo-kernel/configure.ac
===================================================================
--- /trunk/zoo-project/zoo-kernel/configure.ac	(revision 458)
+++ /trunk/zoo-project/zoo-kernel/configure.ac	(revision 459)
@@ -66,4 +66,46 @@
 AC_SUBST([GDAL_CFLAGS])
 AC_SUBST([GDAL_LIBS])
+
+# ===========================================================================
+# Detect if fastcgi is available
+# ===========================================================================
+
+AC_ARG_WITH([fastcgi],
+        [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])],
+        [FCGIPATH="$withval"], [FCGIPATH=""])
+
+# Extract the linker and include flags
+FCGI_LDFLAGS="-L$FCGIPATH/lib"
+FCGI_CPPFLAGS="-I$FCGIPATH/include"
+
+# Check headers file
+CPPFLAGS_SAVE="$CPPFLAGS"
+CPPFLAGS="$FCGI_CPPFLAGS"
+AC_CHECK_HEADERS([fcgi_stdio.h],
+                 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
+
+AC_SUBST([FCGI_CPPFLAGS])
+AC_SUBST([FCGI_LDFLAGS])
+
+# ===========================================================================
+# Detect if proj is installed
+# ===========================================================================
+
+AC_ARG_WITH([proj],
+        [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])],
+        [PROJPATH="$withval"], [PROJPATH=""])
+
+# Extract the linker and include flags
+PROJ_LDFLAGS="-L$PROJPATH/lib"
+PROJ_CPPFLAGS="-I$PROJPATH/include"
+
+# Check headers file
+CPPFLAGS_SAVE="$CPPFLAGS"
+CPPFLAGS="$PROJ_CPPFLAGS"
+AC_CHECK_HEADERS([proj_api.h],
+                 [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
+
+AC_SUBST([PROJ_CPPFLAGS])
+AC_SUBST([PROJ_LDFLAGS])
 
 # ===========================================================================
@@ -154,4 +196,43 @@
 
 # ===========================================================================
+# Detect if ruby is installed
+# ===========================================================================
+AC_ARG_WITH([ruby], 
+	[AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation,  disabled by default])], 
+	[RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""])
+
+AC_ARG_WITH([rvers], 
+	[AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])], 
+	[RUBY_VERS="$withval"], [RUBY_VERS=""])
+
+
+if test -z "$RUBY_ENABLED"
+then
+	RUBY_FILE=""
+else
+	RUBY_FILE="service_internal_ruby.o"
+
+	# Extract the linker and include flags 
+	RUBY_LDFLAGS="-lruby"
+	RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS"
+
+	# Check headers file
+	CPPFLAGS_SAVE="$CPPFLAGS"
+	CPPFLAGS="$RUBY_CPPFLAGS"
+	AC_CHECK_HEADERS([ruby.h],
+		 [], [AC_MSG_ERROR([could not find headers include related to libruby])])
+
+	# Ensure we can link against libphp
+	LIBS_SAVE="$LIBS"
+	LIBS="$RUBY_LDFLAGS"
+	# AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
+	AC_SUBST([RUBY_CPPFLAGS])
+	AC_SUBST([RUBY_LDFLAGS])
+fi
+
+AC_SUBST([RUBY_ENABLED])
+AC_SUBST([RUBY_FILE])
+
+# ===========================================================================
 # Detect if python is installed
 # ===========================================================================
@@ -187,5 +268,5 @@
 	# Extract the linker and include flags 
 	PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
-	PYTHON_CPPFLAGS=`$PYTHONCONFIG --cflags`
+	PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes`
 
 	# Check headers file
Index: /trunk/zoo-project/zoo-kernel/service_internal.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/service_internal.c	(revision 458)
+++ /trunk/zoo-project/zoo-kernel/service_internal.c	(revision 459)
@@ -883,5 +883,5 @@
 
 void printFullDescription(elements *elem,const char* type,xmlNsPtr ns_ows,xmlNodePtr nc1){
-  char *orderedFields[7];
+  char *orderedFields[12];
   orderedFields[0]="mimeType";
   orderedFields[1]="encoding";
@@ -891,6 +891,11 @@
   orderedFields[5]="CRS";
   orderedFields[6]="value";
-
-  xmlNodePtr nc2,nc3,nc4,nc5,nc6,nc7;
+  orderedFields[7]="AllowedValues";
+  orderedFields[8]="rangeMin";
+  orderedFields[9]="rangeMax";
+  orderedFields[10]="rangeClosure";
+  orderedFields[11]="rangeSpace";
+
+  xmlNodePtr nc2,nc3,nc4,nc5,nc6,nc7,nc8;
   elements* e=elem;
   map* tmp1=NULL;
@@ -956,5 +961,5 @@
       int dcnt=0;
       int oI=0;
-      for(oI=0;oI<7;oI++)
+      for(oI=0;oI<12;oI++)
 	if((tmp1=getMap(_tmp->content,orderedFields[oI]))!=NULL){
 	  //while(tmp1!=NULL){
@@ -977,5 +982,6 @@
 	     strcasecmp(tmp1->name,"extension")!=0 &&
 	     strcasecmp(tmp1->name,"value")!=0 &&
-	     strncasecmp(tmp1->name,"AllowedValues",13)!=0){
+	     strncasecmp(tmp1->name,"AllowedValues",13)!=0&&
+	     strncasecmp(tmp1->name,"range",5)!=0){
 	    if(datatype!=1){
 	      char *tmp2=zCapitalize1(tmp1->name);
@@ -993,12 +999,13 @@
 	  }else 
 	    if(strncmp(type,"Input",5)==0){
+
 	      if(strcmp(tmp1->name,"value")==0){
 		nc7 = xmlNewNode(NULL, BAD_CAST "DefaultValue");
 		xmlAddChild(nc7,xmlNewText(BAD_CAST tmp1->value));
 		default1=1;
+		hasDefault=true;
 	      }
 	      if(strncasecmp(tmp1->name,"AllowedValues",13)==0){
 		nc6 = xmlNewNode(ns_ows, BAD_CAST "AllowedValues");
-		fprintf(stderr,"ALLOWED VALUE %s\n",tmp1->value);
 		char *token,*saveptr1;
 		token=strtok_r(tmp1->value,",",&saveptr1);
@@ -1008,12 +1015,62 @@
 		  tmps[strlen(tmps)]=0;
 		  xmlAddChild(nc7,xmlNewText(BAD_CAST tmps));
-		  fprintf(stderr,"strgin : %s\n",tmps);
 		  xmlAddChild(nc6,nc7);
 		  token=strtok_r(NULL,",",&saveptr1);
 		}
+		if(getMap(_tmp->content,"rangeMin")!=NULL ||
+		   getMap(_tmp->content,"rangeMax")!=NULL ||
+		   getMap(_tmp->content,"rangeClosure")!=NULL )
+		  goto doRange;
 		xmlAddChild(nc3,nc6);
 		isAnyValue=-1;
 	      }
-	      hasDefault=true;
+	      if(strncasecmp(tmp1->name,"range",5)==0){
+		if(isAnyValue==1){
+		  nc6 = xmlNewNode(ns_ows, BAD_CAST "AllowedValues");
+		doRange:
+		  nc8 = xmlNewNode(ns_ows, BAD_CAST "Range");
+		  map *tmp0=getMap(tmp1,"rangeMin");
+		  if(tmp0!=NULL){
+		    nc7 = xmlNewNode(ns_ows, BAD_CAST "MinimumValue");
+		    xmlAddChild(nc7,xmlNewText(BAD_CAST tmp0->value));
+		    xmlAddChild(nc8,nc7);
+		  }else{
+		    nc7 = xmlNewNode(ns_ows, BAD_CAST "MinimumValue");
+		    xmlAddChild(nc8,nc7);
+		  }
+		  tmp0=getMap(tmp1,"rangeMax");
+		  if(tmp0!=NULL){
+		    nc7 = xmlNewNode(ns_ows, BAD_CAST "MaximumValue");
+		    xmlAddChild(nc7,xmlNewText(BAD_CAST tmp0->value));
+		    xmlAddChild(nc8,nc7);
+		  }else{
+		    nc7 = xmlNewNode(ns_ows, BAD_CAST "MaximumValue");
+		    xmlAddChild(nc8,nc7);
+		  }
+		  tmp0=getMap(tmp1,"rangeSpacing");
+		  if(tmp0!=NULL){
+		    nc7 = xmlNewNode(ns_ows, BAD_CAST "Spacing");
+		    xmlAddChild(nc7,xmlNewText(BAD_CAST tmp0->value));
+		    xmlAddChild(nc8,nc7);
+		  }
+		  tmp0=getMap(tmp1,"rangeClosure");
+		  if(tmp0!=NULL){
+		    char *tmp="closed";
+		    if(strcasecmp(tmp0->value,"co")==0)
+		      tmp="closed-open";
+		    else
+		      if(strcasecmp(tmp0->value,"oc")==0)
+			tmp="open-closed";
+		      else
+			if(strcasecmp(tmp0->value,"o")==0)
+			  tmp="open";
+		    xmlNewNsProp(nc8,ns_ows,BAD_CAST "rangeClosure",BAD_CAST tmp);
+		  }else
+		    xmlNewNsProp(nc8,ns_ows,BAD_CAST "rangeClosure",BAD_CAST "closed");
+		}
+		xmlAddChild(nc6,nc8);
+		xmlAddChild(nc3,nc6);
+		isAnyValue=-1;
+	      }
 	    }
 	  tmp1=tmp1->next;
@@ -1026,16 +1083,18 @@
 	    xmlAddChild(nc3,nc5);
 	  }
-	 
 	  if(strncmp(type,"Input",5)==0){
-	    if(datatype==1 && isAnyValue==1 && avcnt==0){
-	      xmlAddChild(nc3,xmlNewNode(ns_ows, BAD_CAST "AnyValue"));
-	      hasDefault=true;
-	      avcnt++;
-	    }
-	    if(datatype==1 && default1>0){
+	    if(datatype==1 && isAnyValue==1 && default1>0){
 	      xmlAddChild(nc3,nc7);
 	    }
 	  }
-	}
+	 
+	}
+      if(strncmp(type,"Input",5)==0){
+	if(datatype==1 && isAnyValue==1 && avcnt==0){
+	  xmlAddChild(nc3,xmlNewNode(ns_ows, BAD_CAST "AnyValue"));
+	  hasDefault=true;
+	  avcnt++;
+	}
+      }
     }
 
@@ -1119,8 +1178,8 @@
       xmlAddChild(nc3,nc4);
       xmlAddChild(nc2,nc3);
-    }else if(datatype!=2){
-      if(hasDefault!=true && strncmp(type,"Input",5)==0)
+    }/*else if(datatype!=2){
+      if(hasDefault!=true && strncmp(type,"Input",5)==0 && isAnyValue==1)
 	xmlAddChild(nc3,xmlNewNode(ns_ows, BAD_CAST "AnyValue"));
-    }
+	}*/
     
     xmlAddChild(nc1,nc2);
@@ -1772,4 +1831,26 @@
   maps* tmpMap=getMaps(m,"main");
   char *encoding=getEncoding(tmpMap);
+  char *exceptionCode;
+  
+  map* tmp=getMap(s,"code");
+  if(tmp!=NULL){
+    if(strcmp(tmp->value,"OperationNotSupported")==0)
+      exceptionCode="501 Not Implemented";
+    else
+      if(strcmp(tmp->value,"MissingParameterValue")==0 ||
+	 strcmp(tmp->value,"InvalidUpdateSequence")==0 ||
+	 strcmp(tmp->value,"OptionNotSupported")==0 ||
+	 strcmp(tmp->value,"VersionNegotiationFailed")==0 ||
+	 strcmp(tmp->value,"InvalidParameterValue")==0)
+	exceptionCode="400 Bad request";
+      else
+	if(strcmp(tmp->value,"NoApplicableCode")==0)
+	  exceptionCode="501 Internal Server Error";
+	else
+	  exceptionCode="501 Internal Server Error";
+  }
+  else
+    exceptionCode="501 Internal Server Error";
+
   if(m!=NULL){
     map *tmpSid=getMapFromMaps(m,"lenv","sid");
@@ -1777,13 +1858,13 @@
       if( getpid()==atoi(tmpSid->value) ){
 	printHeaders(m);
-	printf("Content-Type: text/xml; charset=%s\r\nStatus: 200 OK\r\n\r\n",encoding);
+	printf("Content-Type: text/xml; charset=%s\r\nStatus: %s\r\n\r\n",encoding,exceptionCode);
       }
     }
     else{
       printHeaders(m);
-      printf("Content-Type: text/xml; charset=%s\r\nStatus: 200 OK\r\n\r\n",encoding);
+      printf("Content-Type: text/xml; charset=%s\r\nStatus: %s\r\n\r\n",encoding,exceptionCode);
     }
   }else{
-    printf("Content-Type: text/xml; charset=%s\r\nStatus: 200 OK\r\n\r\n",encoding);
+    printf("Content-Type: text/xml; charset=%s\r\nStatus: %s\r\n\r\n",encoding,exceptionCode);
   }
   n=createExceptionReportNode(m,s,1);
@@ -1829,4 +1910,9 @@
   else
     xmlNewProp(nc,BAD_CAST "exceptionCode",BAD_CAST "NoApplicableCode");
+
+  tmp=getMap(s,"locator");
+  if(tmp!=NULL && strcasecmp(tmp->value,"NULL")!=0)
+    xmlNewProp(nc,BAD_CAST "locator",BAD_CAST tmp->value);
+
 
   tmp=getMap(s,"text");
@@ -2630,5 +2716,5 @@
     fcontent=(char*)malloc((res.nDataLen+1)*sizeof(char));
     if(fcontent == NULL){
-      return errorException(m, _("Unable to allocate memory."), "InternalError");
+      return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
     }
     size_t dwRead;
@@ -2639,5 +2725,5 @@
   }
   if(fsize==0){
-    return errorException(m, _("Unable to download the file."), "InternalError");
+    return errorException(m, _("Unable to download the file."), "InternalError",NULL);
   }
 
@@ -2668,8 +2754,12 @@
 }
 
-int errorException(maps *m, const char *message, const char *errorcode) 
+int errorException(maps *m, const char *message, const char *errorcode, const char *locator) 
 {
   map* errormap = createMap("text", message);
   addToMap(errormap,"code", errorcode);
+  if(locator!=NULL)
+    addToMap(errormap,"locator", locator);
+  else
+    addToMap(errormap,"locator", "NULL");
   printExceptionReportResponse(m,errormap);
   freeMap(&errormap);
Index: /trunk/zoo-project/zoo-kernel/service_internal.h
===================================================================
--- /trunk/zoo-project/zoo-kernel/service_internal.h	(revision 458)
+++ /trunk/zoo-project/zoo-kernel/service_internal.h	(revision 459)
@@ -132,5 +132,5 @@
   char* addDefaultValues(maps**,elements*,maps*,int);
 
-  int errorException(maps *m, const char *message, const char *errorcode);
+  int errorException(maps *, const char *, const char *, const char*);
 
   int checkForSoapEnvelope(xmlDocPtr);
Index: /trunk/zoo-project/zoo-kernel/service_internal_ruby.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/service_internal_ruby.c	(revision 458)
+++ /trunk/zoo-project/zoo-kernel/service_internal_ruby.c	(revision 459)
@@ -369,5 +369,5 @@
   if (istatus < 0 || istatus > 100){
     fprintf(stderr,"Status must be a percentage.");
-    return NULL;
+    return Qnil;
   }else{
      char tmpStatus[4];
Index: /trunk/zoo-project/zoo-kernel/zoo_loader.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/zoo_loader.c	(revision 458)
+++ /trunk/zoo-project/zoo-kernel/zoo_loader.c	(revision 459)
@@ -110,5 +110,5 @@
        }
        if(res==NULL && (strQuery==NULL || strlen(strQuery)==0)){
-	 return errorException(NULL,"ZOO-Kernel failed to process your request cause the request was emtpty.","InternalError");
+	 return errorException(NULL,"ZOO-Kernel failed to process your request cause the request was emtpty.","InternalError",NULL);
        }else{
 	 if(strQuery==NULL || strlen(strQuery)==0)
Index: /trunk/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 458)
+++ /trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 459)
@@ -152,5 +152,5 @@
 	char emsg[1024];
 	sprintf(emsg,_("You set maximum occurences for <%s> as %i but you tried to use it more than the limit you set. Please correct your ZCFG file or your request."),mi->name,atoi(testMap->value));
-	errorException(m,emsg,"InternalError");
+	errorException(m,emsg,"InternalError",NULL);
 	return -1;
       }
@@ -165,5 +165,5 @@
 	  map* tmpMap=getMap(mi->content,"length");
 	  sprintf(emsg,_("ZOO-Kernel was unable to load your data for %s position %s."),mi->name,tmpMap->value);
-	  errorException(m,emsg,"InternalError");
+	  errorException(m,emsg,"InternalError",NULL);
 	  return -1;
 	}
@@ -172,5 +172,5 @@
 	char emsg[1024];
 	sprintf(emsg,_("You set maximum occurences for <%s> to one but you tried to use it more than once. Please correct your ZCFG file or your request."),mi->name);
-	errorException(m,emsg,"InternalError");
+	errorException(m,emsg,"InternalError",NULL);
 	return -1;
       }
@@ -221,5 +221,5 @@
   }
   sprintf(tmp,_("ZOO Kernel failed to process your request receiving signal %d = %s"),sig,ssig);
-  errorException(NULL, tmp, "InternalError");
+  errorException(NULL, tmp, "InternalError",NULL);
 #ifdef DEBUG
   fprintf(stderr,"Not this time!\n");
@@ -556,5 +556,5 @@
   m=(maps*)malloc(MAPS_SIZE);
   if(m == NULL){
-    return errorException(m, _("Unable to allocate memory."), "InternalError");
+    return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
   }
   char ntmp[1024];
@@ -570,5 +570,5 @@
   snprintf(conf_file,10240,"%s/%s/main.cfg",ntmp,r_inputs->value);
   if(conf_read(conf_file,m)==2){
-    errorException(NULL, _("Unable to load the main.cfg file."),"InternalError");
+    errorException(NULL, _("Unable to load the main.cfg file."),"InternalError",NULL);
     free(m);
     return 1;
@@ -654,5 +654,5 @@
   r_inputs=getMap(request_inputs,"Request");
   if(request_inputs==NULL || r_inputs==NULL){ 
-    errorException(m, _("Parameter <request> was not specified"),"MissingParameterValue");
+    errorException(m, _("Parameter <request> was not specified"),"MissingParameterValue","request");
     freeMaps(&m);
     free(m);
@@ -664,5 +664,5 @@
        && strncasecmp(r_inputs->value,"DescribeProcess",15)!=0
        && strncasecmp(r_inputs->value,"Execute",7)!=0){ 
-      errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "InvalidParameterValue");
+      errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "InvalidParameterValue","request");
       freeMaps(&m);
       free(m);
@@ -674,14 +674,12 @@
   r_inputs=getMap(request_inputs,"Service");
   if(r_inputs==NULLMAP){
-    errorException(m, _("Parameter <service> was not specified"),"MissingParameterValue");
+    errorException(m, _("Parameter <service> was not specified"),"MissingParameterValue","service");
     freeMaps(&m);
     free(m);
     free(REQUEST);
     return 1;
-  }
-  if(strncasecmp(REQUEST,"GetCapabilities",15)!=0){
-    r_inputs=getMap(request_inputs,"Version");
-    if(r_inputs==NULL){ 
-      errorException(m, _("Parameter <version> was not specified"),"MissingParameterValue");
+  }else{
+    if(strcasecmp(r_inputs->value,"WPS")!=0){
+      errorException(m, _("Unenderstood <service> value, WPS is the only acceptable value."), "InvalidParameterValue","service");
       freeMaps(&m);
       free(m);
@@ -689,4 +687,22 @@
       return 1;
     }
+  }
+  if(strncasecmp(REQUEST,"GetCapabilities",15)!=0){
+    r_inputs=getMap(request_inputs,"Version");
+    if(r_inputs==NULL){ 
+      errorException(m, _("Parameter <version> was not specified"),"MissingParameterValue","version");
+      freeMaps(&m);
+      free(m);
+      free(REQUEST);
+      return 1;
+    }else{
+      if(strcasecmp(r_inputs->value,"1.0.0")!=0){
+	errorException(m, _("Unenderstood <version> value, 1.0.0 is the only acceptable value."), "InvalidParameterValue","service");
+	freeMaps(&m);
+	free(m);
+	free(REQUEST);
+	return 1;
+      }
+    } 
   }
 
@@ -726,5 +742,5 @@
     DIR *dirp = opendir(conf_dir);
     if(dirp==NULL){
-      return errorException(m, _("The specified path doesn't exist."),"InvalidParameterValue");
+      return errorException(m, _("The specified path doesn't exist."),"InvalidParameterValue","metapath");
     }
     xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0");
@@ -748,5 +764,5 @@
 	s1=(service*)malloc(SERVICE_SIZE);
 	if(s1 == NULL){ 
-	  return errorException(m, _("Unable to allocate memory."),"InternalError");
+	  return errorException(m, _("Unable to allocate memory."),"InternalError",NULL);
 	}
 #ifdef DEBUG
@@ -779,5 +795,5 @@
     if(r_inputs==NULL 
        || strlen(r_inputs->name)==0 || strlen(r_inputs->value)==0){ 
-      errorException(m, _("Mandatory <identifier> was not specified"),"MissingParameterValue");
+      errorException(m, _("Mandatory <identifier> was not specified"),"MissingParameterValue","identifier");
       freeMaps(&m);
       free(m);
@@ -790,5 +806,5 @@
     DIR *dirp = opendir(conf_dir);
     if(dirp==NULL){
-      errorException(m, _("The specified path path doesn't exist."),"InvalidParameterValue");
+      errorException(m, _("The specified path path doesn't exist."),"InvalidParameterValue",conf_dir);
       freeMaps(&m);
       free(m);
@@ -833,5 +849,5 @@
 	    if(s1 == NULL){
 	      dup2(saved_stdout,fileno(stdout));
-	      return errorException(m, _("Unable to allocate memory."),"InternalError");
+	      return errorException(m, _("Unable to allocate memory."),"InternalError",NULL);
 	    }
 #ifdef DEBUG
@@ -863,5 +879,5 @@
     else
       if(strncasecmp(REQUEST,"Execute",strlen(REQUEST))!=0){
-	errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "InvalidParameterValue");
+	errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "InvalidParameterValue","request");
 #ifdef DEBUG
 	fprintf(stderr,"No request found %s",REQUEST);
@@ -885,5 +901,5 @@
     free(REQUEST);
     free(SERVICE_URL);
-    return errorException(m, _("Unable to allocate memory."),"InternalError");
+    return errorException(m, _("Unable to allocate memory."),"InternalError",NULL);
   }
   r_inputs=getMap(request_inputs,"MetaPath");
@@ -908,5 +924,5 @@
     
     sprintf(tmpMsg,_("The value for <indetifier> seems to be wrong (%s). Please, ensure that the process exist using the GetCapabilities request."),r_inputs->value);
-    errorException(m, tmpMsg, "InvalidParameterValue");
+    errorException(m, tmpMsg, "InvalidParameterValue","identifier");
     free(tmpMsg);
     free(s1);
@@ -982,5 +998,5 @@
       char** outputs_as_text=(char**)malloc(128*sizeof(char*));
       if(outputs_as_text == NULL) {
-	return errorException(m, _("Unable to allocate memory"), "InternalError");
+	return errorException(m, _("Unable to allocate memory"), "InternalError",NULL);
       }
       i=0;
@@ -993,5 +1009,5 @@
 	outputs_as_text[i]=(char*)malloc((strlen(pToken)+1)*sizeof(char));
 	if(outputs_as_text[i] == NULL) {
-	  return errorException(m, _("Unable to allocate memory"), "InternalError");
+	  return errorException(m, _("Unable to allocate memory"), "InternalError",NULL);
 	}
 	snprintf(outputs_as_text[i],strlen(pToken)+1,"%s",pToken);
@@ -1010,5 +1026,5 @@
 	      tmp_output=(maps*)malloc(MAPS_SIZE);
 	      if(tmp_output == NULL){
-		return errorException(m, _("Unable to allocate memory."), "InternalError");
+		return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 	      }
 	      tmp_output->name=zStrdup(tmpc);
@@ -1067,5 +1083,5 @@
       snprintf(cursor_input,40960,"%s",r_inputs->value);
     else{
-      errorException(m, _("Parameter <DataInputs> was not specified"),"MissingParameterValue");
+      errorException(m, _("Parameter <DataInputs> was not specified"),"MissingParameterValue","DataInputs");
       freeMaps(&m);
       free(m);
@@ -1095,5 +1111,5 @@
     char** inputs_as_text=(char**)malloc(100*sizeof(char*));
     if(inputs_as_text == NULL){
-      return errorException(m, _("Unable to allocate memory."), "InternalError");
+      return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
     }
     i=0;
@@ -1109,5 +1125,5 @@
       snprintf(inputs_as_text[i],strlen(pToken)+1,"%s",pToken);
       if(inputs_as_text[i] == NULL){
-	return errorException(m, _("Unable to allocate memory."), "InternalError");
+	return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
       }
       pToken = strtok(NULL,";");
@@ -1141,5 +1157,5 @@
 	  tmpmaps=(maps*)malloc(MAPS_SIZE);
 	  if(tmpmaps == NULL){
-	    return errorException(m, _("Unable to allocate memory."), "InternalError");
+	    return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 	  }
 	  tmpmaps->name=zStrdup(tmpn);
@@ -1195,5 +1211,5 @@
 		char emsg[1024];
 		sprintf(emsg,_("Unable to find a valid protocol to download the remote file %s"),tmpv1+1);
-		errorException(m,emsg,"InternalError");
+		errorException(m,emsg,"InternalError",NULL);
 		freeMaps(&m);
 		free(m);
@@ -1312,5 +1328,5 @@
 	      tmpmaps=(maps*)malloc(MAPS_SIZE);
 	      if(tmpmaps == NULL){
-		return errorException(m, _("Unable to allocate memory."), "InternalError");
+		return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 	      }
 	      tmpmaps->name=zStrdup((char*)val);
@@ -1330,5 +1346,5 @@
 	      tmpmaps=(maps*)malloc(MAPS_SIZE);
 	      if(tmpmaps == NULL){
-		return errorException(m, _("Unable to allocate memory."), "InternalError");
+		return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 	      }
 	      tmpmaps->name=zStrdup("missingIndetifier");
@@ -1428,5 +1444,5 @@
 		    has=(char*)malloc((3+strlen((char*)val)+strlen(key))*sizeof(char));
 		    if(has == NULL){
-		      return errorException(m, _("Unable to allocate memory."), "InternalError");
+		      return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 		    }
 		    snprintf(has,(3+strlen((char*)val)+strlen(key)),"%s: %s",key,(char*)val);
@@ -1478,5 +1494,5 @@
 		    char* tmpContent = (char*)malloc((res.nDataLen+1)*sizeof(char));
 		    if(tmpContent == NULL){
-		      return errorException(m, _("Unable to allocate memory."), "InternalError");
+		      return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 		    }
 		    size_t dwRead;
@@ -1513,5 +1529,5 @@
 		      (char*)malloc((res1.nDataLen+1)*sizeof(char));
 		    if(tmp == NULL){
-		      return errorException(m, _("Unable to allocate memory."), "InternalError");
+		      return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 		    }
 		    size_t bRead;
@@ -1531,5 +1547,5 @@
 		      char* tmpContent = (char*)malloc((res.nDataLen+1)*sizeof(char));
 		      if(tmpContent == NULL){
-			return errorException(m, _("Unable to allocate memory."), "InternalError");
+			return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 		      }
 		      size_t dwRead;
@@ -1750,5 +1766,5 @@
 	  tmpmaps=(maps*)malloc(MAPS_SIZE);
 	  if(tmpmaps == NULL){
-	    return errorException(m, _("Unable to allocate memory."), "InternalError");
+	    return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 	  }
 	  tmpmaps->name=zStrdup("unknownIdentifier");
@@ -1792,5 +1808,5 @@
 	      tmpmaps=(maps*)malloc(MAPS_SIZE);
 	      if(tmpmaps == NULL){
-		return errorException(m, _("Unable to allocate memory."), "InternalError");
+		return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 	      }
 	      tmpmaps->name=zStrdup((char*)val);
@@ -1829,5 +1845,5 @@
 	      tmpmaps=(maps*)malloc(MAPS_SIZE);
 	      if(tmpmaps == NULL){
-		return errorException(m, _("Unable to allocate memory."), "InternalError");
+		return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 	      }
 	      tmpmaps->name=zStrdup("missingIndetifier");
@@ -1878,5 +1894,5 @@
 		  tmpmaps=(maps*)malloc(MAPS_SIZE);
 		  if(tmpmaps == NULL){
-		    return errorException(m, _("Unable to allocate memory."), "InternalError");
+		    return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 		  }
 		  tmpmaps->name=zStrdup((char*)val);
@@ -1901,5 +1917,5 @@
 		  tmpmaps=(maps*)malloc(MAPS_SIZE);
 		  if(tmpmaps == NULL){
-		    return errorException(m, _("Unable to allocate memory."), "InternalError");
+		    return errorException(m, _("Unable to allocate memory."), "InternalError",NULL);
 		  }
 		  tmpmaps->name=zStrdup("missingIndetifier");
@@ -1963,12 +1979,14 @@
   if(strcmp(dfv1,"")!=0 || strcmp(dfv,"")!=0){
     char tmps[1024];
+    map* tmpe=createMap("code","MissingParameterValue");
     if(strcmp(dfv,"")!=0){
       snprintf(tmps,1024,_("The <%s> argument was not specified in DataInputs but defined as requested in ZOO ServicesProvider configuration file, please correct your query or the ZOO Configuration file."),dfv);
+      addToMap(tmpe,"locator",dfv);
     }
     else if(strcmp(dfv1,"")!=0){
       snprintf(tmps,1024,_("The <%s> argument was specified as Output identifier but not defined in the ZOO Configuration File. Please, correct your query or the ZOO Configuration File."),dfv1);
-    }
-    map* tmpe=createMap("text",tmps);
-    addToMap(tmpe,"code","MissingParameterValue");
+      addToMap(tmpe,"locator",dfv1);
+    }
+    addToMap(tmpe,"text",tmps);
     printExceptionReportResponse(m,tmpe);
     freeService(&s1);
@@ -2116,5 +2134,5 @@
   if(status!=NULL && strcmp(status->value,"true")==0 && 
      store!=NULL && strcmp(store->value,"false")==0){
-    errorException(m, _("Status cannot be set to true with storeExecuteResponse to false. Please, modify your request parameters."), "InvalidParameterValue");
+    errorException(m, _("Status cannot be set to true with storeExecuteResponse to false. Please, modify your request parameters."), "InvalidParameterValue","storeExecuteResponse");
     freeService(&s1);
     free(s1);
@@ -2329,5 +2347,5 @@
        */
       eres=-1;
-      errorException(m, _("Unable to run the child process properly"), "InternalError");
+      errorException(m, _("Unable to run the child process properly"), "InternalError",NULL);
     }
   }
