- Timestamp:
- May 29, 2014, 8:16:48 PM (10 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal.c
r478 r481 2092 2092 int nsid=zooXmlAddNs(NULL,"http://www.opengis.net/ows","ows"); 2093 2093 ns=usedNs[nsid]; 2094 if(use_ns==1){ 2095 ns=NULL; 2096 } 2094 2097 n = xmlNewNode(ns, BAD_CAST "ExceptionReport"); 2095 2096 2098 if(use_ns==1){ 2097 ns_ows=xmlNewNs(n,BAD_CAST "http://www.opengis.net/ows/1.1 .0",BAD_CAST "ows");2099 ns_ows=xmlNewNs(n,BAD_CAST "http://www.opengis.net/ows/1.1",NULL); 2098 2100 int xsiId=zooXmlAddNs(n,"http://www.w3.org/2001/XMLSchema-instance","xsi"); 2099 2101 ns_xsi=usedNs[xsiId]; 2100 ns_xsi=xmlNewNs(n,BAD_CAST "http://www.w3.org/2001/XMLSchema-instance",BAD_CAST "xsi");2101 2102 xmlNewNsProp(n,ns_xsi,BAD_CAST "schemaLocation",BAD_CAST "http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd"); 2102 int xlinkId=zooXmlAddNs(n,"http://www.w3.org/1999/xlink","xlink");2103 ns_xlink=usedNs[xlinkId]; 2104 } 2103 } 2104 2105 2105 2106 addLangAttr(n,m); 2106 2107 xmlNewProp(n,BAD_CAST "version",BAD_CAST "1.1.0"); … … 2194 2195 } 2195 2196 2196 if(res==SERVICE_FAILED){2197 map * errormap;2198 map *lenv;2199 lenv=getMapFromMaps(m,"lenv","message");2200 char *tmp0;2201 if(lenv!=NULL){2202 tmp0=(char*)malloc((strlen(lenv->value)+strlen(_("Unable to run the Service. The message returned back by the Service was the following: "))+1)*sizeof(char));2203 sprintf(tmp0,_("Unable to run the Service. The message returned back by the Service was the following: %s"),lenv->value);2204 }2205 else{2206 tmp0=(char*)malloc((strlen(_("Unable to run the Service. No more information was returned back by the Service."))+1)*sizeof(char));2207 sprintf(tmp0,_("Unable to run the Service. No more information was returned back by the Service."));2208 }2209 errormap = createMap("text",tmp0);2210 free(tmp0);2211 addToMap(errormap,"code", "InternalError");2212 printExceptionReportResponse(m,errormap);2213 freeMap(&errormap);2214 free(errormap);2215 return;2216 }2217 2197 2218 2198 if(asRaw==0){ … … 2342 2322 } 2343 2323 else{ 2324 if(res==SERVICE_FAILED){ 2325 map * errormap; 2326 map *lenv; 2327 lenv=getMapFromMaps(m,"lenv","message"); 2328 char *tmp0; 2329 if(lenv!=NULL){ 2330 tmp0=(char*)malloc((strlen(lenv->value)+strlen(_("Unable to run the Service. The message returned back by the Service was the following: "))+1)*sizeof(char)); 2331 sprintf(tmp0,_("Unable to run the Service. The message returned back by the Service was the following: %s"),lenv->value); 2332 } 2333 else{ 2334 tmp0=(char*)malloc((strlen(_("Unable to run the Service. No more information was returned back by the Service."))+1)*sizeof(char)); 2335 sprintf(tmp0,_("Unable to run the Service. No more information was returned back by the Service.")); 2336 } 2337 errormap = createMap("text",tmp0); 2338 free(tmp0); 2339 addToMap(errormap,"code", "InternalError"); 2340 printExceptionReportResponse(m,errormap); 2341 freeMap(&errormap); 2342 free(errormap); 2343 return; 2344 } 2344 2345 /** 2345 2346 * We get the requested output or fallback to the first one if the -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r478 r481 791 791 freeMaps(&m); 792 792 free(m); 793 if(request_inputs!=NULL){794 freeMap(&request_inputs);795 free(request_inputs);796 }797 793 return 1; 798 794 }
Note: See TracChangeset
for help on using the changeset viewer.