Changeset 72
- Timestamp:
- Jan 13, 2011, 5:36:55 PM (14 years ago)
- Location:
- trunk/zoo-kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service_internal.c
r71 r72 2 2 * Author : Gérald FENOY 3 3 * 4 * Copyright (c) 2009-201 0GeoLabs SARL4 * Copyright (c) 2009-2011 GeoLabs SARL 5 5 * 6 6 * Permission is hereby granted, free of charge, to any person obtaining a copy … … 1048 1048 char tmp[256]; 1049 1049 char url[1024]; 1050 char stored_path[1024]; 1050 1051 memset(tmp,0,256); 1051 memset(url,0,256); 1052 memset(url,0,1024); 1053 memset(stored_path,0,1024); 1052 1054 maps* tmp_maps=getMaps(m,"main"); 1053 1055 if(tmp_maps!=NULL){ … … 1099 1101 if(tmpm1!=NULL) 1100 1102 sprintf(tmp,"%s/",tmpm1->value); 1101 } 1103 tmpm1=getMapFromMaps(m,"main","TmpPath"); 1104 sprintf(stored_path,"%s/%s_%i.xml",tmpm1->value,service,pid); 1105 } 1106 1107 1102 1108 1103 1109 xmlNewProp(n,BAD_CAST "serviceInstance",BAD_CAST tmp); 1104 if(status!=SERVICE_SUCCEEDED && status!=SERVICE_FAILED){ 1110 map* test=getMap(request,"storeExecuteResponse"); 1111 bool hasStoredExecuteResponse=false; 1112 if(test!=NULL && strcasecmp(test->value,"true")==0){ 1105 1113 xmlNewProp(n,BAD_CAST "statusLocation",BAD_CAST url); 1114 hasStoredExecuteResponse=true; 1106 1115 } 1107 1116 … … 1236 1245 #endif 1237 1246 xmlDocSetRootElement(doc, n); 1247 if(hasStoredExecuteResponse){ 1248 /* We need to write the ExecuteResponse Document somewhere */ 1249 FILE* output=fopen(stored_path,"w"); 1250 xmlChar *xmlbuff; 1251 int buffersize; 1252 xmlDocDumpFormatMemoryEnc(doc, &xmlbuff, &buffersize, "UTF-8", 1); 1253 fwrite(xmlbuff,1,strlen(xmlbuff)*sizeof(char),output); 1254 xmlFree(xmlbuff); 1255 fclose(output); 1256 } 1238 1257 printDocument(m,doc,pid); 1239 1258 -
trunk/zoo-kernel/zoo_service_loader.c
r69 r72 1700 1700 */ 1701 1701 r_inputs=NULL; 1702 map* store=getMap(request_inputs,"storeExecuteResponse"); 1703 map* status=getMap(request_inputs,"status"); 1704 /** 1705 * 05-007r7 WPS 1.0.0 page 57 : 1706 * 'If status="true" and storeExecuteResponse is "false" then the service 1707 * shall raise an exception.' 1708 */ 1709 if(status!=NULL && strcmp(status->value,"true")==0 && 1710 store!=NULL && strcmp(store->value,"false")==0){ 1711 errorException(m, _("Status cannot be set to true with storeExecuteResponse to false. Please, modify your request parameters."), "InvalidParameterValue"); 1712 freeService(&s1); 1713 free(s1); 1714 freeMaps(&m); 1715 free(m); 1716 1717 freeMaps(&request_input_real_format); 1718 free(request_input_real_format); 1719 1720 freeMaps(&request_output_real_format); 1721 free(request_output_real_format); 1722 1723 free(REQUEST); 1724 free(SERVICE_URL); 1725 return 1; 1726 } 1702 1727 r_inputs=getMap(request_inputs,"storeExecuteResponse"); 1703 1728 int eres=SERVICE_STARTED; … … 1719 1744 #endif 1720 1745 1721 if( r_inputs!=NULL)1722 if(strcasecmp( r_inputs->value,"false")==0)1723 r_inputs=NULL;1724 if( r_inputs==NULLMAP){1746 if(status!=NULL) 1747 if(strcasecmp(status->value,"false")==0) 1748 status=NULL; 1749 if(status==NULLMAP){ 1725 1750 loadServiceAndRun(&m,s1,request_inputs,&request_input_real_format,&request_output_real_format,&eres); 1726 1751 }
Note: See TracChangeset
for help on using the changeset viewer.