Changeset 967 for trunk/zoo-project/zoo-kernel/zoo_service_loader.c
- Timestamp:
- Dec 18, 2020, 2:13:22 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r966 r967 419 419 420 420 map* errormap = createMap("text", tmp01); 421 map* tmpMap=getMapFromMaps(m," lenv","executionType");421 map* tmpMap=getMapFromMaps(m,"main","executionType"); 422 422 char* errorCode=(char*)code; 423 423 if(tmpMap!=NULL && strncasecmp(tmpMap->value,"json",4)==0) … … 1888 1888 maps *request_input_real_format = NULL; 1889 1889 1890 setMapInMaps(m," lenv","executionType","xml");1890 setMapInMaps(m,"main","executionType","xml"); 1891 1891 if((strlen(cgiQueryString)>0 && cgiQueryString[0]=='/') /*&& strstr(cgiAccept,"json")!=NULL*/){ 1892 1892 // 1893 // OGC API - Process ingstarts here1893 // OGC API - Processes starts here 1894 1894 // 1895 1895 #ifndef USE_JSON 1896 errorException (m, _("OGC API - Process ing is not supported by this ZOO-Kernel."), "InternalError", NULL);1896 errorException (m, _("OGC API - Processes is not supported by this ZOO-Kernel, please contact the service provider."), "InternalError", NULL); 1897 1897 return 1; 1898 1898 #else … … 1908 1908 signal (SIGABRT, json_sig_handler); 1909 1909 #endif 1910 setMapInMaps(m,"main","executionType","json"); 1910 1911 r_inputs = getMapOrFill (&request_inputs, "metapath", ""); 1911 1912 char conf_file1[10240]; … … 1920 1921 } 1921 1922 addMapsToMaps(&m,m1); 1922 setMapInMaps(m,"lenv","executionType","json");1923 1923 map* pmTmp0=getMapFromMaps(m,"openapi","full_html_support"); 1924 dumpMap(pmTmp0);1925 1924 if(strstr(cgiQueryString,".html")==NULL && strstr(cgiAccept,"text/html")!=NULL && pmTmp0!=NULL && strncasecmp(pmTmp0->value,"true",4)==0){ 1926 1925 map* pmTmpUrl=getMapFromMaps(m,"openapi","rootUrl"); … … 2305 2304 }else{ 2306 2305 char* jobId=zStrdup(strstr(cgiQueryString,"/jobs/")+6); 2307 runGetStatus(m,jobId,"GetStatus"); 2308 map* pmError=getMapFromMaps(m,"lenv","error"); 2309 if(pmError!=NULL && strncasecmp(pmError->value,"true",4)==0){ 2310 printExceptionReportResponseJ(m,getMapFromMaps(m,"lenv","code")); 2311 return 1; 2312 }else{ 2313 map* pmStatus=getMapFromMaps(m,"lenv","status"); 2314 setMapInMaps(m,"lenv","gs_location","false"); 2315 setMapInMaps(m,"lenv","gs_usid",jobId); 2316 if(pmStatus!=NULL && strncasecmp(pmStatus->value,"Failed",6)==0) 2317 res=createStatus(m,SERVICE_FAILED); 2318 else 2319 if(pmStatus!=NULL && strncasecmp(pmStatus->value,"Succeeded",9)==0) 2320 res=createStatus(m,SERVICE_SUCCEEDED); 2321 else 2322 if(pmStatus!=NULL && strncasecmp(pmStatus->value,"Running",7)==0){ 2323 map* tmpMap=getMapFromMaps(m,"lenv","Message"); 2324 if(tmpMap!=NULL) 2325 setMapInMaps(m,"lenv","gs_message",tmpMap->value); 2326 res=createStatus(m,SERVICE_STARTED); 2327 } 2328 else 2329 res=createStatus(m,SERVICE_FAILED); 2330 } 2306 res=printJobStatus(m,jobId); 2331 2307 free(jobId); 2332 2308 } … … 2530 2506 map* testMap=getMapFromMaps(m,"main","memory"); 2531 2507 loadHttpRequests(m,request_input_real_format); 2532 dumpMaps(request_input_real_format); 2508 2509 if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,NULL)<0) 2510 return -1; 2533 2511 loadServiceAndRun (&m, s1, request_inputs, 2534 2512 &request_input_real_format, … … 2548 2526 }else{ 2549 2527 loadHttpRequests(m,request_input_real_format); 2528 if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,NULL)<0) 2529 return -1; 2550 2530 loadServiceAndRun (&m,s1,request_inputs, 2551 2531 &request_input_real_format, … … 2560 2540 } 2561 2541 } 2562 if(res!=NULL){ 2542 map* pmHasPrinted=getMapFromMaps(m,"lenv","hasPrinted"); 2543 if(res!=NULL && (pmHasPrinted==NULL || strncasecmp(pmHasPrinted->value,"false",5)==0)){ 2563 2544 if(getMapFromMaps(m,"lenv","no-headers")==NULL){ 2564 2545 printHeaders(m); … … 2573 2554 #endif 2574 2555 }else{ 2575 2576 2556 // 2577 2557 // WPS 1.0.0 and 2.0.0 starts here 2578 2558 // 2559 setMapInMaps(m,"main","executionType","xml"); 2579 2560 //Check for minimum inputs 2580 2561 map* version=getMap(request_inputs,"version"); … … 3435 3416 signal (SIGABRT, donothing); 3436 3417 #endif 3418 fprintf(stderr,"%s %d \n",__FILE__,__LINE__); 3419 fflush(stderr); 3437 3420 3438 3421 if (((int) zGetpid ()) != cpid || cgiSid != NULL) 3439 3422 { 3423 fprintf(stderr,"%s %d \n",__FILE__,__LINE__); 3424 fflush(stderr); 3440 3425 if (eres == SERVICE_SUCCEEDED) 3441 3426 #ifdef USE_CALLBACK … … 3495 3480 if(cgiSid!=NULL) 3496 3481 free(cgiSid); 3497 map* tMap=getMapFromMaps(m," lenv","executionType");3482 map* tMap=getMapFromMaps(m,"main","executionType"); 3498 3483 if(tMap!=NULL && strncasecmp(tMap->value,"xml",3)==0) 3499 3484 InternetCloseHandle (&hInternet); … … 3524 3509 free (REQUEST); 3525 3510 free (SERVICE_URL); 3511 3526 3512 #ifdef DEBUG 3527 3513 fprintf (stderr, "Processed response \n");
Note: See TracChangeset
for help on using the changeset viewer.