Index: /trunk/zoo-project/zoo-kernel/response_print.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/response_print.c	(revision 784)
+++ /trunk/zoo-project/zoo-kernel/response_print.c	(revision 785)
@@ -757,7 +757,7 @@
       char* ckey=level->value;
       if(strncasecmp(level->value,"profile",7)==0)
-	ckey="generic";
+	ckey=(char*)"generic";
       if(strncasecmp(level->value,"generic",7)==0)
-	ckey="concept";
+	ckey=(char*)"concept";
       service* inherited=getServiceFromRegistry(reg,ckey,tmp1->value);
       if(inherited!=NULL){
@@ -1537,5 +1537,5 @@
     memset(url,0,1024);
     maps* tmp_maps=getMaps(m,"main");
-    if(tmp_maps!=NULL){
+    if(tmp_maps!=NULL && tmp_maps->content!=NULL){
       map* tmpm1=getMap(tmp_maps->content,"serverAddress");
       /**
@@ -1561,5 +1561,4 @@
 	sprintf(file_path,"%s/GetStatus.zcfg",ntmp);
       }
-      fprintf(stderr,"%s \n",file_path);
       statRes=stat(file_path,&myFileInfo);
       if(statRes==0){
@@ -1761,5 +1760,5 @@
       xmlAddChild(n,nc);
   }
-  
+
   if(vid==0 && 
      hasStoredExecuteResponse==true 
@@ -1965,5 +1964,5 @@
   if(tmpMap==NULL){
     nc2=xmlNewNode(ns_wps, BAD_CAST "Data");
-    if(e!=NULL){
+    if(e!=NULL && e->format!=NULL){
       if(strncasecmp(e->format,"LiteralOutput",strlen(e->format))==0)
 	nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData");
@@ -2425,5 +2424,5 @@
     map *usid=getMapFromMaps(m,"lenv","usid");
     addToMap(statusInfo,"JobID",usid->value);
-    printStatusInfo(m,statusInfo,"Execute");
+    printStatusInfo(m,statusInfo,(char*)"Execute");
     freeMap(&statusInfo);
     free(statusInfo);
@@ -2451,8 +2450,6 @@
 	  gfile=getMap(tmpI->content,"generated_file");
 	}
-	readGeneratedFile(m,tmpI->content,gfile->value);	    
-	file_name=(char*)malloc((strlen(gfile->value)+strlen(tmp1->value)+1)*sizeof(char));
-	for(int i=0;i<strlen(gfile->value);i++)
-	  file_name[i]=gfile->value[i+strlen(tmp1->value)];
+	readGeneratedFile(m,tmpI->content,gfile->value);
+	file_name=zStrdup((gfile->value)+strlen(tmp1->value));
       }
 
@@ -2467,8 +2464,8 @@
 	  char *format=NULL;
 	  if(in!=NULL && in->format!=NULL){
-	    format=zStrdup(in->format);
+	    format=in->format;
 	  }else
-	    format=zStrdup("LiteralData");
-	  if(strcasecmp(format,"BoundingBoxData")==0){
+	    format=(char*)"LiteralData";
+	  if(format!=NULL && strcasecmp(format,"BoundingBoxData")==0){
 	    addToMap(tmpI->content,"extension","xml");
 	    addToMap(tmpI->content,"mimeType","text/xml");
@@ -2535,7 +2532,5 @@
 	    sprintf(file_url,"%s/%s/%s",tmp3->value,tmp2->value,file_name);
 	  }
-
 	  addToMap(tmpI->content,"Reference",file_url);
-	  free(format);
 	  free(file_name);
 	  free(file_url);
Index: /trunk/zoo-project/zoo-kernel/response_print.h
===================================================================
--- /trunk/zoo-project/zoo-kernel/response_print.h	(revision 784)
+++ /trunk/zoo-project/zoo-kernel/response_print.h	(revision 785)
@@ -136,7 +136,8 @@
    * Definitions of acceptable final status
    */
-  static char wpsStatus[2][11]={
+  static char wpsStatus[3][11]={
     "Succeeded",
-    "Failed"
+    "Failed",
+    "Running"
   };
   /**
Index: /trunk/zoo-project/zoo-kernel/server_internal.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/server_internal.c	(revision 784)
+++ /trunk/zoo-project/zoo-kernel/server_internal.c	(revision 785)
@@ -251,9 +251,9 @@
   }else{
     if(tmp!=NULL){
-      tmp1==zStrdup(tmp);
+      tmp1=zStrdup(tmp);
       free(tmp);
     }else{
       if(tmp0!=NULL){
-	tmp1==zStrdup(tmp0);
+	tmp1=zStrdup(tmp0);
 	free(tmp0);
       }
Index: /trunk/zoo-project/zoo-kernel/sqlapi.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/sqlapi.c	(revision 784)
+++ /trunk/zoo-project/zoo-kernel/sqlapi.c	(revision 785)
@@ -27,4 +27,5 @@
 #include "ogrsf_frmts.h"
 #include "ogr_p.h"
+#include "response_print.h"
 #if GDAL_VERSION_MAJOR >= 2
 #include <gdal_priv.h>
@@ -219,10 +220,14 @@
 				strlen(uusid->value)+
 				strlen(osid->value)+
-				strlen(sid->value)+56+1)*sizeof(char));
+				strlen(sid->value)+
+				strlen(wpsStatus[2])+66+1)*sizeof(char));
   sprintf(sqlQuery,
-	  "INSERT INTO %s.services (uuid,sid,osid)"
-	  "VALUES ('%s','%s','%s');",
+	  "INSERT INTO %s.services (uuid,sid,osid,fstate)"
+	  "VALUES ('%s','%s','%s','%s');",
 	  schema->value,
-	  uusid->value,sid->value,osid->value);
+	  uusid->value,
+	  sid->value,
+	  osid->value,
+	  wpsStatus[2]);
   execSql(conf,sqlQuery);
   free(sqlQuery);
