Index: trunk/zoo-kernel/Makefile.in
===================================================================
--- trunk/zoo-kernel/Makefile.in	(revision 113)
+++ trunk/zoo-kernel/Makefile.in	(revision 114)
@@ -93,8 +93,8 @@
 
 zoo_service_loader.o: zoo_service_loader.c service.h
-	g++ -g -O2 -Wall ${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
+	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 ${PYTHON_FILE}   ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE}
-	g++ -g -O2 -Wall ${JSCFLAGS} ${PHPCFLAGS}  ${PERLCFLAGS}   ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c  -fno-common -DPIC -o zoo_loader.o
+	g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS}  ${PERLCFLAGS}   ${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 ${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 -lcurl -L../thirds/cgic206 -lcgic -lcurl ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MACOS_LD_FLAGS}
 
Index: trunk/zoo-kernel/main_conf_read.y
===================================================================
--- trunk/zoo-kernel/main_conf_read.y	(revision 113)
+++ trunk/zoo-kernel/main_conf_read.y	(revision 114)
@@ -25,5 +25,5 @@
 using namespace std;
 
-extern void crerror(char *s);
+extern void crerror(const char *s);
 
 void usage(void) ;
@@ -304,5 +304,5 @@
 /* fonction qui affiche l erreur si il y en a une */
 //======================================================
-void crerror(char *s)
+void crerror(const char *s)
 {
   if(debug)
@@ -314,5 +314,5 @@
 /* fonction principale : entrée dans le programme */
 //======================================================
-int conf_read(char* file,maps* my_map){
+int conf_read(const char* file,maps* my_map){
   
   crin = fopen(file,"r");
Index: trunk/zoo-kernel/service.h
===================================================================
--- trunk/zoo-kernel/service.h	(revision 113)
+++ trunk/zoo-kernel/service.h	(revision 114)
@@ -55,4 +55,27 @@
 #define SHMSZ     27
 
+
+  /**
+   * \struct map
+   * \brief KVP linked list
+   *
+   * Deal with WPS KVP (name,value).
+   * A map is defined as:
+   *  - name : a key,
+   *  - value: a value,
+   *  - next : a pointer to the next map if any.
+   */
+  typedef struct map{
+    char* name;
+    char* value;
+    struct map* next;
+  } map;
+
+#ifdef WIN32
+#define NULLMAP ((map*) 0)
+#else
+#define NULLMAP NULL
+#endif
+
   /**
    * \struct maps
@@ -60,4 +83,8 @@
    *
    * Small object to store WPS KVP set.
+   * Maps is defined as:
+   *  - a name, 
+   *  - a content map,
+   *  - a pointer to the next maps if any.
    */
   typedef struct maps{
@@ -68,21 +95,6 @@
 
   /**
-   * \struct map
-   * \brief KVP linked list
-   *
-   * Deal with WPS KVP (name,value).
+   * \brief Dump a map on stderr
    */
-  typedef struct map{
-    char* name;       /* The key */
-    char* value;      /* The value */
-    struct map* next; /* Next couple */
-  } map;
-
-#ifdef WIN32
-#define NULLMAP ((map*) 0)
-#else
-#define NULLMAP NULL
-#endif
-
   static void _dumpMap(map* t){
     if(t!=NULL){
@@ -181,5 +193,5 @@
   }
 
-  static map* getMapFromMaps(maps* m,char* key,char* subkey){
+  static map* getMapFromMaps(maps* m,const char* key,const char* subkey){
     maps* _tmpm=getMaps(m,key);
     if(_tmpm!=NULL){
@@ -224,4 +236,13 @@
   }
 
+  /**
+   * \brief Not named linked list
+   *
+   * Used to store informations about formats, such as mimeType, encoding ... 
+   *
+   * An iotype is defined as :
+   *  - a content map,
+   *  - a pointer to the next iotype if any.
+   */
   typedef struct iotype{
     struct map* content;
@@ -229,4 +250,18 @@
   } iotype;
 
+  /**
+   * \brief Metadata information about input or output.
+   *
+   * The elements are used to store metadata informations defined in the ZCFG.
+   *
+   * An elements is defined as :
+   *  - a name,
+   *  - a content map,
+   *  - a metadata map,
+   *  - a format (possible values are LiteralData, ComplexData or 
+   * BoundingBoxData),
+   *  - a default iotype,
+   *  - a pointer to the next elements id any.
+   */
   typedef struct elements{
     char* name;
@@ -252,5 +287,5 @@
   } services;
 
-  static bool hasElement(elements* e,char* key){
+  static bool hasElement(elements* e,const char* key){
     elements* tmp=e;
     while(tmp!=NULL){
@@ -476,5 +511,5 @@
 
 
-  static void setMapInMaps(maps* m,char* key,char* subkey,char *value){
+  static void setMapInMaps(maps* m,const char* key,const char* subkey,const char *value){
     maps* _tmpm=getMaps(m,key);
     if(_tmpm!=NULL){
Index: trunk/zoo-kernel/service_conf.y
===================================================================
--- trunk/zoo-kernel/service_conf.y	(revision 113)
+++ trunk/zoo-kernel/service_conf.y	(revision 114)
@@ -36,5 +36,4 @@
 static int previous_data=0;
 static int current_data=0;
-static char* myFinalObjectAsJSON="{";
 // namespace
 using namespace std;
@@ -42,5 +41,5 @@
 
 // srerror
-void srerror(char *s);
+void srerror(const char *s);
 //======================================================
 
@@ -713,5 +712,5 @@
 /* fonction qui affiche l erreur si il y en a une */
 //======================================================
-void srerror(char *s)
+void srerror(const char *s)
 {
   if(debug)
@@ -724,5 +723,5 @@
  * definition file.
  */
-int getServiceFromFile(char* file,service** service){
+int getServiceFromFile(const char* file,service** service){
 
   freeMap(&previous_content);
Index: trunk/zoo-kernel/service_internal.c
===================================================================
--- trunk/zoo-kernel/service_internal.c	(revision 113)
+++ trunk/zoo-kernel/service_internal.c	(revision 114)
@@ -130,5 +130,5 @@
 	tmpMap=getMapFromMaps(conf,"lenv","status");
 	s1=shm;
-	for(s=tmpMap->value;*s!=NULL;s++)
+	for(s=tmpMap->value;s!=NULL;s++)
 	  *s1++=*s;
 	shmdt((void *)shm);
@@ -216,5 +216,5 @@
 
 
-int zooXmlSearchForNs(char* name){
+int zooXmlSearchForNs(const char* name){
   int i;
   int res=-1;
@@ -227,5 +227,5 @@
 }
 
-int zooXmlAddNs(xmlNodePtr nr,char* url,char* name){
+int zooXmlAddNs(xmlNodePtr nr,const char* url,const char* name){
 #ifdef DEBUG
   fprintf(stderr,"zooXmlAddNs %d \n",nbNs);
@@ -266,5 +266,5 @@
 }
 
-xmlNodePtr printGetCapabilitiesHeader(xmlDocPtr doc,char* service,maps* m){
+xmlNodePtr printGetCapabilitiesHeader(xmlDocPtr doc,const char* service,maps* m){
 
   xmlNsPtr ns,ns_ows,ns_xlink,ns_xsi;
@@ -618,5 +618,5 @@
 }
 
-xmlNodePtr printDescribeProcessHeader(xmlDocPtr doc,char* service,maps* m){
+xmlNodePtr printDescribeProcessHeader(xmlDocPtr doc,const char* service,maps* m){
 
   xmlNsPtr ns,ns_ows,ns_xlink,ns_xsi;
@@ -711,5 +711,5 @@
 }
 
-void printFullDescription(elements *elem,char* type,xmlNsPtr ns_ows,xmlNodePtr nc1){
+void printFullDescription(elements *elem,const char* type,xmlNsPtr ns_ows,xmlNodePtr nc1){
   char *orderedFields[7];
   orderedFields[0]="mimeType";
@@ -957,5 +957,5 @@
 }
 
-void printProcessResponse(maps* m,map* request, int pid,service* serv,char* service,int status,maps* inputs,maps* outputs){
+void printProcessResponse(maps* m,map* request, int pid,service* serv,const char* service,int status,maps* inputs,maps* outputs){
   xmlNsPtr ns,ns_ows,ns_xlink,ns_xsi;
   xmlNodePtr nr,n,nc,nc1,nc2,nc3,pseudor;
@@ -1217,5 +1217,5 @@
    */
   xmlDocDumpFormatMemoryEnc(doc, &xmlbuff, &buffersize, encoding, 1);
-  printf((char *) xmlbuff);
+  printf("%s",xmlbuff);
   //fflush(stdout);
   /*
@@ -1228,5 +1228,5 @@
 }
 
-void printOutputDefinitions1(xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_wps,xmlNsPtr ns_ows,elements* e,maps* m,char* type){
+void printOutputDefinitions1(xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_wps,xmlNsPtr ns_ows,elements* e,maps* m,const char* type){
   xmlNodePtr nc1;
   nc1=xmlNewNode(ns_wps, BAD_CAST type);
@@ -1260,5 +1260,5 @@
 }
 
-void printOutputDefinitions(xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_wps,xmlNsPtr ns_ows,elements* e,map* m,char* type){
+void printOutputDefinitions(xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_wps,xmlNsPtr ns_ows,elements* e,map* m,const char* type){
   xmlNodePtr nc1,nc2,nc3;
   nc1=xmlNewNode(ns_wps, BAD_CAST type);
@@ -1288,5 +1288,5 @@
 }
 
-void printIOType(xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_wps,xmlNsPtr ns_ows,xmlNsPtr ns_xlink,elements* e,maps* m,char* type){
+void printIOType(xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_wps,xmlNsPtr ns_ows,xmlNsPtr ns_xlink,elements* e,maps* m,const char* type){
   xmlNodePtr nc1,nc2,nc3;
   nc1=xmlNewNode(ns_wps, BAD_CAST type);
@@ -1443,5 +1443,5 @@
 }
 
-void printDescription(xmlNodePtr root,xmlNsPtr ns_ows,char* identifier,map* amap){
+void printDescription(xmlNodePtr root,xmlNsPtr ns_ows,const char* identifier,map* amap){
   xmlNodePtr nc2 = xmlNewNode(ns_ows, BAD_CAST "Identifier");
   xmlAddChild(nc2,xmlNewText(BAD_CAST identifier));
@@ -1708,5 +1708,5 @@
 	  freeMap(&errormap);
 	  free(errormap);
-	  return 1;
+	  return;
 	}
 	char mime[1024];
@@ -1972,9 +1972,9 @@
  * Note : support only 2D bounding box.
  */
-map* parseBoundingBox(char* value){
+map* parseBoundingBox(const char* value){
   map *res=NULL;
   if(value!=NULL){
     char *cv,*cvp;
-    cv=strtok_r(value,",",&cvp);
+    cv=strtok_r((char*) value,",",&cvp);
     int cnt=0;
     int icnt=0;
@@ -2089,5 +2089,5 @@
   xmlDocDumpFormatMemoryEnc(doc, &xmlbuff, &buffersize, encoding, 1);
   if(file==NULL)
-    printf((char *) xmlbuff);
+    printf("%s",xmlbuff);
   else{
     fprintf(file,"%s",xmlbuff);
Index: trunk/zoo-kernel/service_internal.h
===================================================================
--- trunk/zoo-kernel/service_internal.h	(revision 113)
+++ trunk/zoo-kernel/service_internal.h	(revision 114)
@@ -54,6 +54,6 @@
 #include <openssl/buffer.h>
 
-extern   int getServiceFromFile(char*,service**);
-extern   int conf_read(char*,maps*);
+extern   int getServiceFromFile(const char*,service**);
+extern   int conf_read(const char*,maps*);
 
 #ifdef USE_JS
@@ -84,23 +84,23 @@
   char* getEncoding(maps*);
 
-  int zooXmlSearchForNs(char*);
-  int zooXmlAddNs(xmlNodePtr,char*,char*);
+  int zooXmlSearchForNs(const char*);
+  int zooXmlAddNs(xmlNodePtr,const char*,const char*);
   void zooXmlCleanupNs();
   
   void printExceptionReportResponse(maps*,map*);
   xmlNodePtr createExceptionReportNode(maps*,map*,int);
-  void printProcessResponse(maps*,map*,int,service*,char*,int,maps*,maps*);
-  xmlNodePtr printGetCapabilitiesHeader(xmlDocPtr,char*,maps*);
+  void printProcessResponse(maps*,map*,int,service*,const char*,int,maps*,maps*);
+  xmlNodePtr printGetCapabilitiesHeader(xmlDocPtr,const char*,maps*);
   void printGetCapabilitiesForProcess(maps*,xmlNodePtr,service*);
-  xmlNodePtr printDescribeProcessHeader(xmlDocPtr,char*,maps*);
+  xmlNodePtr printDescribeProcessHeader(xmlDocPtr,const char*,maps*);
   void printDescribeProcessForProcess(maps*,xmlNodePtr,service*,int);
-  void printFullDescription(elements*,char*,xmlNsPtr,xmlNodePtr);
+  void printFullDescription(elements*,const char*,xmlNsPtr,xmlNodePtr);
   void printDocument(maps*,xmlDocPtr,int);
-  void printDescription(xmlNodePtr,xmlNsPtr,char*,map*);
-  void printIOType(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,xmlNsPtr,elements*,maps*,char*);
-  map* parseBoundingBox(char*);
+  void printDescription(xmlNodePtr,xmlNsPtr,const char*,map*);
+  void printIOType(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,xmlNsPtr,elements*,maps*,const char*);
+  map* parseBoundingBox(const char*);
   void printBoundingBox(xmlNsPtr,xmlNodePtr,map*);
   void printBoundingBoxDocument(maps*,maps*,FILE*);
-  void printOutputDefinitions1(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,elements*,maps*,char*);
+  void printOutputDefinitions1(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,elements*,maps*,const char*);
   
   void outputResponse(service*,maps*,maps*,map*,int,maps*,int);
Index: trunk/zoo-kernel/service_internal_java.c
===================================================================
--- trunk/zoo-kernel/service_internal_java.c	(revision 113)
+++ trunk/zoo-kernel/service_internal_java.c	(revision 114)
@@ -2,5 +2,5 @@
  * Author : Gérald FENOY
  *
- * Copyright (c) 2009-2010 GeoLabs SARL
+ * Copyright (c) 2009-2011 GeoLabs SARL
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -118,5 +118,5 @@
 
       pValue=(*env)->CallStaticIntMethod(env,cls,pmid,arg1,arg2,arg3);
-      if (pValue != NULL){
+      if (pValue != (jint)NULL){
 	res=pValue;
 	m=mapsFromHashMap(env,arg1,scHashMapClass);
@@ -233,5 +233,7 @@
   jobject scObject,scObject1;
   if(scHashMapClass==NULL){
+#ifdef DEBUG
     fprintf(stderr,"Unable to load java.util.HashMap\n");
+#endif
     return NULL;
   }
@@ -239,12 +241,21 @@
   containsKey_mid = (*env)->GetMethodID(env, scHashMapClass, "containsKey", "(Ljava/lang/Object;)Z");
   get_mid = (*env)->GetMethodID(env, scHashMapClass, "get", "(Ljava/lang/Object;)Ljava/lang/Object;"); 
+
   if(containsKey_mid==0){
+#ifdef DEBUG
     fprintf(stderr,"unable to load containsKey from HashMap object (%d) \n",entrySet_mid);
+#endif
+    return NULL;
   }
   if(get_mid==0){
+#ifdef DEBUG
     fprintf(stderr,"unable to load get from HashMap object (%d) \n",entrySet_mid);
+#endif
+    return NULL;
   }
   if(entrySet_mid==0){
+#ifdef DEBUG
     fprintf(stderr,"unable to load entrySet from HashMap object (%d) \n",entrySet_mid);
+#endif
     return NULL;
   }
@@ -296,7 +307,8 @@
     if((*env)->CallBooleanMethod(env,imap,containsKey_mid,(*env)->NewStringUTF(env,"size"))){
       jobject sizeV=(*env)->CallObjectMethod(env, imap, get_mid,(*env)->NewStringUTF(env,"size"));
-      jstring sizeVS=(*env)->GetStringUTFChars(env, sizeV, NULL);
+      const char* sizeVS=(*env)->GetStringUTFChars(env, sizeV, NULL);
       size=atoi(sizeVS);
       fprintf(stderr,"SIZE : %s\n",sizeVS);
+      (*env)->ReleaseStringUTFChars(env, sizeV, sizeVS);
     }
     
@@ -306,7 +318,6 @@
       jobject jv=(*env)->CallObjectMethod(env,tmp1,getValue_mid);
 
-      jstring jkd=(*env)->GetStringUTFChars(env, jk, NULL);
+      const char* jkd=(*env)->GetStringUTFChars(env, jk, NULL);
       if(size>=0 && strcmp(jkd,"value")==0){
-	fprintf(stderr,"%s\n",jkd);
 	jobject value=(*env)->GetByteArrayElements(env, jv, NULL);
 	if(res==NULL){
@@ -315,5 +326,4 @@
 	  addToMap(res,jkd,"");
 	}
-	fprintf(stderr,"/%s\n",jkd);
 	map* tmpR=getMap(res,"value");
 	free(tmpR->value);
@@ -321,8 +331,10 @@
 	memmove(tmpR->value,value,size*sizeof(char));
 	tmpR->value[size]=0;
-	fprintf(stderr,"/%s\n",jkd);
+	char tmp[128];
+	sprintf(tmp,"%d",size);
+	addToMap(res,"size",tmp);
       }
       else{
-	jstring jvd=(*env)->GetStringUTFChars(env, jv, NULL);
+	const char* jvd=(*env)->GetStringUTFChars(env, jv, NULL);
 	if(res==NULL){
 	  res=createMap(jkd,jvd);
@@ -330,5 +342,5 @@
 	  addToMap(res,jkd,jvd);
 	}
-	(*env)->ReleaseStringChars(env, jv, jvd);
+	(*env)->ReleaseStringUTFChars(env, jv, jvd);
       }
 
@@ -337,5 +349,5 @@
 #endif
 
-      (*env)->ReleaseStringChars(env, jk, jkd);
+      (*env)->ReleaseStringUTFChars(env, jk, jkd);
 
     }
Index: trunk/zoo-kernel/service_internal_python.c
===================================================================
--- trunk/zoo-kernel/service_internal_python.c	(revision 113)
+++ trunk/zoo-kernel/service_internal_python.c	(revision 114)
@@ -86,15 +86,15 @@
   }
   pModule = PyImport_Import(pName);
-  int i;
   int res=SERVICE_FAILED;
-  int cpid=getpid();
   if (pModule != NULL) {
     pFunc=PyObject_GetAttrString(pModule,s->name);
     if (pFunc && PyCallable_Check(pFunc)){
+      PyObject *pValue;
       PyDictObject* arg1=PyDict_FromMaps(m);
       PyDictObject* arg2=PyDict_FromMaps(inputs);
       PyDictObject* arg3=PyDict_FromMaps(outputs);
       PyObject *pArgs=PyTuple_New(3);
-      PyObject *pValue;
+      if (!pArgs)
+	return -1;
       PyTuple_SetItem(pArgs, 0, (PyObject *)arg1);
       PyTuple_SetItem(pArgs, 1, (PyObject *)arg2);
@@ -130,5 +130,4 @@
 	PyErr_Fetch(&ptype, &pvalue, &ptraceback);
 	PyObject *trace=PyObject_Str(pvalue);
-	char tb[1024];
 	char pbt[10240];
 	if(PyString_Check(trace))
@@ -145,5 +144,4 @@
 	else
 	  fprintf(stderr,"EMPTY TRACE ?");
-	PyObject *t;
 	pName = PyString_FromString("traceback");
 	pModule = PyImport_Import(pName);
@@ -302,5 +300,4 @@
   int nb=PyList_Size(list);
   int i;
-  int sizeValue=-1;
   for(i=0;i<nb;i++){
     PyObject* key=PyList_GetItem(list,i);
Index: trunk/zoo-kernel/zoo_loader.c
===================================================================
--- trunk/zoo-kernel/zoo_loader.c	(revision 113)
+++ trunk/zoo-kernel/zoo_loader.c	(revision 114)
@@ -45,5 +45,5 @@
 }
 
-xmlXPathObjectPtr extractFromDoc(xmlDocPtr,char*);
+xmlXPathObjectPtr extractFromDoc(xmlDocPtr,const char*);
 int runRequest(map*);
 
@@ -192,5 +192,5 @@
 	addToMap(tmpMap,"language",tval);
       
-      char* requests[3];
+      const char* requests[3];
       requests[0]="GetCapabilities";
       requests[1]="DescribeProcess";
@@ -206,5 +206,5 @@
 #endif
 	  if(req!=NULL && req->nodeNr==1){
-	    t1->value=requests[j];
+	    t1->value=strdup(requests[j]);
 	    j=2;
 	  }
Index: trunk/zoo-kernel/zoo_service_loader.c
===================================================================
--- trunk/zoo-kernel/zoo_service_loader.c	(revision 113)
+++ trunk/zoo-kernel/zoo_service_loader.c	(revision 114)
@@ -94,5 +94,5 @@
 }
 
-xmlXPathObjectPtr extractFromDoc(xmlDocPtr doc,char* search){
+xmlXPathObjectPtr extractFromDoc(xmlDocPtr doc,const char* search){
   xmlXPathContextPtr xpathCtx;
   xmlXPathObjectPtr xpathObj;
@@ -110,5 +110,5 @@
 void sig_handler(int sig){
   char tmp[100];
-  char *ssig;
+  const char *ssig;
   switch(sig){
   case SIGSEGV:
@@ -153,5 +153,5 @@
   map* r_inputs=NULL;
 #ifndef WIN32
-  getcwd(ntmp,1024);
+  char* pntmp=getcwd(ntmp,1024);
 #else
   _getcwd(ntmp,1024);
@@ -360,7 +360,6 @@
 #endif
 
-  map* r_inputs=NULL,*tmps=NULL;
+  map* r_inputs=NULL;
   maps* m=NULL;
-  int argc=count(request_inputs);
 
   char* REQUEST=NULL;
@@ -374,5 +373,5 @@
   char ntmp[1024];
 #ifndef WIN32
-  getcwd(ntmp,1024);
+  char *pntmp=getcwd(ntmp,1024);
 #else
   _getcwd(ntmp,1024);
@@ -470,5 +469,4 @@
   }
 
-  map* outputs=NULL;
   maps* request_output_real_format=NULL;
   map* tmpm=getMapFromMaps(m,"main","serverAddress");
@@ -478,5 +476,4 @@
     SERVICE_URL=strdup(DEFAULT_SERVICE_URL);
 
-  service* s[100];
   service* s1;
   int scount=0;
@@ -497,5 +494,4 @@
 
   if(strncasecmp(REQUEST,"GetCapabilities",15)==0){
-    int i=0;
     struct dirent *dp;
 #ifdef DEBUG
@@ -510,5 +506,4 @@
     r_inputs=getMap(request_inputs,"ServiceProvider");
     xmlNodePtr n;
-    //dumpMap(request_inputs);
     if(r_inputs!=NULL)
       n = printGetCapabilitiesHeader(doc,r_inputs->value,m);
@@ -595,7 +590,4 @@
       char buff[256];
       char buff1[1024];
-      int i=0;
-      int j=0;
-      int end=-1;
       int saved_stdout = dup(fileno(stdout));
       dup2(fileno(stderr),fileno(stdout));
@@ -611,5 +603,4 @@
 	    memset(buff1,0,1024);
 	    snprintf(buff1,1024,"%s/%s",conf_dir,dp->d_name);
-	    //s1=(service*)malloc(sizeof(service*));
 	    s1=(service*)calloc(1,SERVICE_SIZE);
 	    if(s1 == NULL){
@@ -640,5 +631,4 @@
       free(SERVICE_URL);
       fflush(stdout);
-      //xmlFree(n);
 #ifndef LINUX_FREE_ISSUE
       if(s1)
@@ -654,5 +644,4 @@
 #endif	
 	closedir(dirp);
-	free(s);
 	return 0;
       }
@@ -703,6 +692,4 @@
   dumpService(s1);
 #endif
-  map* inputs=NULL;
-  elements* c_inputs=s1->inputs;
   int j;
   
@@ -747,5 +734,4 @@
       fprintf(stderr,"OUTPUT Parsing start now ... \n");
 #endif
-      char current_output_as_string[10240];
       char cursor_output[10240];
       char *cotmp=strdup(r_inputs->value);
@@ -753,5 +739,4 @@
       free(cotmp);
       j=0;
-      map* request_kvp_outputs=NULL;
 	
       /**
@@ -834,5 +819,4 @@
 	fflush(stderr);
 #endif
-	//tmp_output=tmp_output->next;
 	free(tmp);
       }
@@ -848,5 +832,4 @@
     fprintf(stderr,"DATA INPUTS [%s]\n",r_inputs->value);
 #endif
-    char current_input_as_string[40960];
     char cursor_input[40960];
     if(r_inputs!=NULL)
@@ -864,5 +847,4 @@
     }
     j=0;
-    map* request_kvp_inputs=NULL;
   
     /**
@@ -907,5 +889,4 @@
 	strncpy(tmpn,tmpc,(strlen(tmpc)-strlen(tmpv))*sizeof(char));
 	tmpn[strlen(tmpc)-strlen(tmpv)]=0;
-	int cnt=0;
 #ifdef DEBUG
 	fprintf(stderr,"***\n*** %s = %s ***\n",tmpn,tmpv+1);
@@ -1010,9 +991,7 @@
     fflush(stderr);
 #endif
-    xmlNodePtr cur = xmlDocGetRootElement(doc);
     /**
      * Parse every Input in DataInputs node.
      */
-    maps* tempMaps=NULL;
     xmlXPathObjectPtr tmpsptr=extractFromDoc(doc,"/*/*/*[local-name()='Input']");
     xmlNodeSet* tmps=tmpsptr->nodesetval;
@@ -1064,5 +1043,5 @@
 		return errorException(m, _("Unable to allocate memory."), "InternalError");
 	      }
-	      tmpmaps->name="missingIndetifier";
+	      tmpmaps->name=strdup("missingIndetifier");
 	      tmpmaps->content=createMap((char*)cur2->name,(char*)val);
 	      tmpmaps->next=NULL;
@@ -1093,6 +1072,5 @@
 	    fprintf(stderr,"REFERENCE\n");
 #endif
-	    map* referenceMap=NULL;
-	    char *refs[5];
+	    const char *refs[5];
 	    refs[0]="mimeType";
 	    refs[1]="encoding";
@@ -1100,5 +1078,4 @@
 	    refs[3]="method";
 	    refs[4]="href";
-	    char*url;
 	    for(int l=0;l<5;l++){
 #ifdef DEBUG
@@ -1142,7 +1119,5 @@
 	    while(cur3){
 	      if(xmlStrcasecmp(cur3->name,BAD_CAST "Header")==0 ){
-		xmlNodePtr cur4=cur3;
-		char *tmp=new char[cgiContentLength];
-		char *ha[2];
+		const char *ha[2];
 		ha[0]="key";
 		ha[1]="value";
@@ -1170,5 +1145,5 @@
 		}
 		hInternet.header=curl_slist_append(hInternet.header, has);
-		//free(has);
+		free(has);
 	      }
 	      else{
@@ -1302,17 +1277,17 @@
 		 * dataType , uom
 		 */
-		char *lits[2];
-		lits[0]="dataType";
-		lits[1]="uom";
+		char *list[2];
+		list[0]=strdup("dataType");
+		list[1]=strdup("uom");
 		for(int l=0;l<2;l++){
 #ifdef DEBUG
-		  fprintf(stderr,"*** LiteralData %s ***",lits[l]);
-#endif
-		  xmlChar *val=xmlGetProp(cur4,BAD_CAST lits[l]);
+		  fprintf(stderr,"*** LiteralData %s ***",list[l]);
+#endif
+		  xmlChar *val=xmlGetProp(cur4,BAD_CAST list[l]);
 		  if(val!=NULL && strlen((char*)val)>0){
 		    if(tmpmaps->content!=NULL)
-		      addToMap(tmpmaps->content,lits[l],(char*)val);
+		      addToMap(tmpmaps->content,list[l],(char*)val);
 		    else
-		      tmpmaps->content=createMap(lits[l],(char*)val);
+		      tmpmaps->content=createMap(list[l],(char*)val);
 		  }
 #ifdef DEBUG
@@ -1320,4 +1295,5 @@
 #endif
 		  xmlFree(val);
+		  free(list[l]);
 		}
 	      }
@@ -1327,5 +1303,5 @@
 		 * mimeType, encoding, schema
 		 */
-		char *coms[3];
+		const char *coms[3];
 		coms[0]="mimeType";
 		coms[1]="encoding";
@@ -1368,5 +1344,4 @@
 		char *res=NULL;
 		char *curs=tmpv->value;
-		int i=0;
 		for(int i=0;i<=strlen(tmpv->value)/64;i++) {
 		  if(res==NULL)
@@ -1421,5 +1396,4 @@
 #endif
     xmlXPathFreeObject(tmpsptr);
-    //xmlFree(tmps);
     
     tmpsptr=extractFromDoc(doc,"/*/*/*[local-name()='ResponseDocument']");
@@ -1439,5 +1413,4 @@
       else
 	addToMap(request_inputs,"ResponseDocument","");
-      request_output_real_format;
       maps *tmpmaps=NULL;
       xmlNodePtr cur=tmps->nodeTab[k];
@@ -1451,5 +1424,5 @@
 	    return errorException(m, _("Unable to allocate memory."), "InternalError");
 	  }
-	  tmpmaps->name="unknownIdentifier";
+	  tmpmaps->name=strdup("unknownIdentifier");
 	  tmpmaps->next=NULL;
 	}
@@ -1458,5 +1431,5 @@
 	 * storeExecuteResponse, lineage, status
 	 */
-	char *ress[3];
+	const char *ress[3];
 	ress[0]="storeExecuteResponse";
 	ress[1]="lineage";
@@ -1487,5 +1460,5 @@
 	     * mimeType, encoding, schema, uom, asReference
 	     */
-	    char *outs[5];
+	    const char *outs[5];
 	    outs[0]="mimeType";
 	    outs[1]="encoding";
@@ -1543,5 +1516,5 @@
 		    return errorException(m, _("Unable to allocate memory."), "InternalError");
 		  }
-		  tmpmaps->name="missingIndetifier";
+		  tmpmaps->name=strdup("missingIndetifier");
 		  tmpmaps->content=createMap((char*)cur2->name,(char*)val);
 		  tmpmaps->next=NULL;
@@ -1563,5 +1536,4 @@
 	}
       }
-      //xmlFree(cur);
       if(request_output_real_format==NULL)
 	request_output_real_format=dupMaps(&tmpmaps);
@@ -1576,5 +1548,4 @@
 
     xmlXPathFreeObject(tmpsptr);
-    //xmlFree(tmps);
     xmlCleanupParser();
   }
