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);
     }
   }
