Index: branches/PublicaMundi_David-devel/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- branches/PublicaMundi_David-devel/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 513)
+++ branches/PublicaMundi_David-devel/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 524)
@@ -1216,5 +1216,5 @@
 
   s1 = NULL;
-  s1 = (service *) malloc (SERVICE_SIZE);
+  /**s1 = (service *) malloc (SERVICE_SIZE);
   if (s1 == NULL)
     {
@@ -1231,5 +1231,7 @@
   else
     snprintf (tmps1, 1024, "%s/", ntmp);
+   **/
   r_inputs = getMap (request_inputs, "Identifier");
+/**
   char *ttmp = zStrdup (tmps1);
   snprintf (tmps1, 1024, "%s/%s.zcfg", ttmp, r_inputs->value);
@@ -1253,6 +1255,9 @@
   t = readServiceFile (m, tmps1, &s1, r_inputs->value);
   fflush (stdout);
+  **/
+  int saved_stdout = dup (fileno (stdout));
   dup2 (saved_stdout, fileno (stdout));
-  if (t < 0)
+  s1 = search_service (r_inputs->value);
+  if (s1 == NULL)
     {
       char *tmpMsg = (char *) malloc (2048 + strlen (r_inputs->value));
@@ -1454,5 +1459,5 @@
           free (SERVICE_URL);
           InternetCloseHandle (&hInternet);
-          freeService (&s1);
+          //freeService (&s1);
           free (s1);
           return 0;
@@ -1618,5 +1623,5 @@
                           free (SERVICE_URL);
                           InternetCloseHandle (&hInternet);
-                          freeService (&s1);
+                          //freeService (&s1);
                           free (s1);
                           return 0;
@@ -1640,5 +1645,5 @@
                               free (SERVICE_URL);
                               InternetCloseHandle (&hInternet);
-                              freeService (&s1);
+                              //freeService (&s1);
                               free (s1);
                               return 0;
@@ -1675,5 +1680,5 @@
                               free (SERVICE_URL);
                               InternetCloseHandle (&hInternet);
-                              freeService (&s1);
+                              //freeService (&s1);
                               free (s1);
                               return 0;
@@ -1744,5 +1749,6 @@
                     {
                       xmlChar *val = xmlNodeListGetString (doc,
-                                                           cur2->xmlChildrenNode,
+                                                           cur2->
+                                                           xmlChildrenNode,
                                                            1);
                       if (tmpmaps == NULL)
@@ -1773,5 +1779,6 @@
                     {
                       xmlChar *val = xmlNodeListGetString (doc,
-                                                           cur2->xmlChildrenNode,
+                                                           cur2->
+                                                           xmlChildrenNode,
                                                            1);
                       if (tmpmaps == NULL)
@@ -1785,5 +1792,5 @@
                                                      "InternalError", NULL);
                             }
-                          tmpmaps->name = zStrdup ("missingIndetifier");
+                          tmpmaps->name = zStrdup ("missingIndentifier");
                           tmpmaps->content =
                             createMap ((char *) cur2->name, (char *) val);
@@ -1858,5 +1865,5 @@
                                           free (SERVICE_URL);
                                           InternetCloseHandle (&hInternet);
-                                          freeService (&s1);
+                                          //freeService (&s1);
                                           free (s1);
                                           return 0;
@@ -2209,6 +2216,5 @@
                             {
                               xmlChar *mv = xmlNodeListGetString (doc,
-                                                                  cur4->
-                                                                  xmlChildrenNode,
+                                                                  cur4->xmlChildrenNode,
                                                                   1);
                               map *ltmp = getMap (tmpmaps->content,
@@ -2256,6 +2262,5 @@
                             {
                               xmlChar *tmp = xmlNodeListGetRawString (doc,
-                                                                      cur4->
-                                                                      xmlChildrenNode,
+                                                                      cur4->xmlChildrenNode,
                                                                       0);
                               addToMap (tmpmaps->content,
@@ -2325,5 +2330,5 @@
                             free (SERVICE_URL);
                             InternetCloseHandle (&hInternet);
-                            freeService (&s1);
+                            //freeService (&s1);
                             free (s1);
                             return 0;
@@ -2424,5 +2429,6 @@
                     {
                       xmlChar *val = xmlNodeListGetString (NULL,
-                                                           cur2->xmlChildrenNode,
+                                                           cur2->
+                                                           xmlChildrenNode,
                                                            1);
                       free (tmpmaps->name);
@@ -2511,5 +2517,6 @@
                       {
                         xmlChar *val = xmlNodeListGetString (doc,
-                                                             cur1->xmlChildrenNode,
+                                                             cur1->
+                                                             xmlChildrenNode,
                                                              1);
                         if (tmpmaps == NULL)
@@ -2571,5 +2578,6 @@
                       {
                         xmlChar *val = xmlNodeListGetString (doc,
-                                                             cur1->xmlChildrenNode,
+                                                             cur1->
+                                                             xmlChildrenNode,
                                                              1);
                         if (tmpmaps == NULL)
@@ -2647,6 +2655,5 @@
                               {
                                 xmlChar *val = xmlNodeListGetString (doc,
-                                                                     cur2->
-                                                                     xmlChildrenNode,
+                                                                     cur2->xmlChildrenNode,
                                                                      1);
                                 if (tmpmaps == NULL)
@@ -2688,6 +2695,5 @@
                               {
                                 xmlChar *val = xmlNodeListGetString (doc,
-                                                                     cur2->
-                                                                     xmlChildrenNode,
+                                                                     cur2->xmlChildrenNode,
                                                                      1);
                                 if (tmpmaps == NULL)
@@ -2790,5 +2796,5 @@
               addToMap (tmpe, "text", tmps);
               printExceptionReportResponse (m, tmpe);
-              freeService (&s1);
+              //freeService (&s1);
               free (s1);
               freeMap (&tmpe);
@@ -2834,5 +2840,5 @@
       addToMap (tmpe, "text", tmps);
       printExceptionReportResponse (m, tmpe);
-      freeService (&s1);
+      //freeService (&s1);
       free (s1);
       freeMap (&tmpe);
@@ -3020,5 +3026,5 @@
                       ("Status cannot be set to true with storeExecuteResponse to false. Please, modify your request parameters."),
                       "InvalidParameterValue", "storeExecuteResponse");
-      freeService (&s1);
+      //freeService (&s1);
       free (s1);
       freeMaps (&m);
@@ -3342,5 +3348,5 @@
     }
 
-  freeService (&s1);
+  //freeService (&s1);
   free (s1);
   freeMaps (&m);
