Changeset 794
- Timestamp:
- Dec 27, 2016, 6:34:38 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/services/howtos.rst
r771 r794 6 6 :ref:`services_index` are quite easy to create once you have installed the ZOO Kernel and have 7 7 chosen code (in the language of your choice) to turn into a ZOO service. Here are some 8 HelloWorlds in Python, PHP, Java and JavaScript with links to their corresponding8 HelloWorlds in Python, PHP, Java, C# and JavaScript with links to their corresponding 9 9 ``.zcfg`` files. 10 11 12 .. contents:: :depth: 3 10 13 11 14 … … 199 202 ---- 200 203 201 Specifically for the Java support, you may add the following t wo204 Specifically for the Java support, you may add the following three 202 205 sections to your ``main.cfg`` file: 203 206 … … 311 314 } 312 315 316 C# 317 ---- 318 319 Specifically for the C# support, you should add the following 320 section to your ``main.cfg`` file. 321 322 323 :[mono]: 324 This section is used to define both ``libPath`` and ``etcPath`` 325 required by the Mono .NET Framework. 326 327 ZOO-API 328 ******* 329 330 Before you build your first ZOO-Service implemented in Mono, you 331 should first build the ``ZMaps.dll`` containing the Mono ZOO-API. 332 333 .. Note:: You should build ZOO-Kernel prior to follow this instructions. 334 335 .. code-block:: guess 336 337 cd zoo-api/mono 338 make 339 340 Then you should copy the ``ZMaps.dll`` in your ``servicePath`` or in 341 the directory where your ``zoo_loader.cgi`` file is stored. 342 343 The ZOO-API is available from a C# class named ZOO_API and provides 344 the following static variables: 345 346 :int SERVICE_SUCCEEDED: 347 Value to return in case your service end successfully. 348 :int SERVICE_FAILED: 349 Value to retrun in case of failure. 350 351 The ZOO-API provides the following static functions: 352 353 :string Translate(String s): 354 This function call the internal ZOO-Kernel function responsible for 355 searching a translation of ``s`` in the zoo-services dictionary. 356 357 :void UpdateStatus(ZMaps conf,String pourcent,String message): 358 This function call the updateStatus ZOO-Kernel function responsible 359 for updating the status of the running service (only usefull when 360 the service has been called asynchronously). 361 362 363 C# ZCFG requirements 364 ********************************** 365 366 .. Note:: For each Service provided by your ZOO Mono Services Provider 367 (your corresponding Mono class), the ZCFG File should have 368 the name of the Mono public static function corresponding to the 369 service (case-sensitive). 370 371 The ZCFG file should contain the following : 372 373 serviceType 374 Mono 375 serviceProvider 376 The full name of the C# dll containing the ZOO-Service Provider 377 (including ``.dll``). 378 serviceNameSpace 379 The namespace of the C# class containing the ZOO-Service Provider. 380 serviceClass 381 The name of the C# class containing the ZOO-Service Provider definition. 382 383 C# Data Structure used 384 ******************************** 385 386 The three parameters of the function are passed to the Mono static 387 function as ``ZMaps`` which are basically 388 ``Dictionary<String,_ZMaps>``. 389 390 Sample ZOO C# Services Provider 391 ****************************************** 392 393 .. literalinclude:: ../../zoo-project/zoo-services/hello-mono/test.cs 394 :language: csharp 395 :lines: 24-100 396 313 397 Javascript 314 398 ---------- -
trunk/workshop/index.rst
r752 r794 12 12 :maxdepth: 1 13 13 14 2016/index 14 15 2015/index 15 16 2014/index -
trunk/zoo-project/HISTORY.txt
r790 r794 1 1 Version 1.6.0-dev 2 * Add the C# as a supported programming language for Services 2 3 * Add nested inputs and outputs support (WPS 2.0.0) 3 4 * Add servicePath special key to specify the service location -
trunk/zoo-project/zoo-kernel/Makefile.in
r784 r794 86 86 gcc -fPIC ${XML2CFLAGS} ${JSCFLAGS} ${CFLAGS} ${JS_ENABLED} -c service_internal_js.c 87 87 88 service_internal_mono.o: service_internal_mono.h service_internal_mono.c service.h 89 gcc -c ${XML2CFLAGS} ${MONO_CFLAGS} ${CFLAGS} ${MONO_ENABLED} service_internal_mono.c 90 88 91 service_internal_ruby.o: service_internal_ruby.c service_internal_ruby.h 89 92 g++ ${XML2CFLAGS} ${RUBYCFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c service_internal_ruby.c … … 92 95 g++ -c ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} service_loader.c 93 96 94 zoo_service_loader.o: zoo_service_loader.c service.h version.h ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} 95 g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${ SAGA_CFLAGS} ${OTBCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED}-c zoo_service_loader.c -fno-common -DPIC -o zoo_service_loader.o97 zoo_service_loader.o: zoo_service_loader.c service.h version.h ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} 98 g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${MONO_CFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} ${MONO_ENABLED} -c zoo_service_loader.c -fno-common -DPIC -o zoo_service_loader.o 96 99 97 100 libzoo_service.${EXT}: version.h service_internal.o service.o sqlapi.o … … 100 103 zoo_loader.cgi: version.h libzoo_service.${EXT} zoo_loader.c zoo_service_loader.o ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o request_parser.o response_print.o server_internal.o caching.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} 101 104 g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${RUBYCFLAGS} ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c -fno-common -DPIC -o zoo_loader.o 102 g++ ${JSCFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o ${MS_FILE} ${PYTHON_FILE} ${PERL_FILE} ${PHP_FILE} ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} response_print.o server_internal.o caching.o request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi -L. ${LDFLAGS}105 g++ ${JSCFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o ${MS_FILE} ${PYTHON_FILE} ${PERL_FILE} ${PHP_FILE} ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} response_print.o server_internal.o caching.o request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi -L. ${LDFLAGS} 103 106 104 107 zcfg2yaml: zcfg2yaml.c service.h lex.sr.o service_conf.tab.o service_conf.y main_conf_read.tab.o lex.cr.o response_print.o server_internal.o service_internal.o ${MS_FILE} ${YAML_FILE} -
trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in
r784 r794 96 96 SAGA_FILE=@SAGA_FILE@ 97 97 98 MONO_CFLAGS=@MONO_CFLAGS@ 99 MONO_LDFLAGS=@MONO_LDFLAGS@ 100 MONO_ENABLED=@MONO_ENABLED@ 101 MONO_FILE=@MONO_FILE@ 102 98 103 CFLAGS=@RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF 99 LDFLAGS=-lzoo_service @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} 104 LDFLAGS=-lzoo_service @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} 100 105 101 106 DATAROOTDIR=@datarootdir@/zoo-project -
trunk/zoo-project/zoo-kernel/configure.ac
r784 r794 637 637 638 638 # =========================================================================== 639 # Detect if mono is installed 640 # =========================================================================== 641 642 AC_ARG_WITH([mono], 643 [AS_HELP_STRING([--with-mono=PATH], [To enable mono support, specify the path to find pkg-config, disabled by default])], 644 [MONOHOME="$withval"; MONO_ENABLED="-DUSE_MONO"], [MONO_ENABLED=""]) 645 646 if test -z "$MONO_ENABLED" 647 then 648 MONO_FILE="" 649 else 650 MONO_FILE="service_internal_mono.o" 651 if test "x$MONOHOME" = "x"; 652 then 653 MONOHOME="/usr" 654 fi 655 if test "x$MONOHOME" = "xyes"; 656 then 657 MONOHOME="/usr" 658 fi 659 660 # Extract the linker and include flags 661 MONO_CFLAGS=`$MONOHOME/bin/pkg-config --cflags mono-2` 662 MONO_LDFLAGS=`$MONOHOME/bin/pkg-config --libs mono-2` 663 664 AC_LANG([C++]) 665 echo $JAVA_CPPFLAGS 666 # Check headers file (second time we check that in fact) 667 CPPFLAGS_SAVE="$CFLAGS" 668 CPPFLAGS="$MONO_CFLAGS" 669 AC_CHECK_HEADERS([mono/jit/jit.h], 670 [], [AC_MSG_ERROR([could not find jit.h file])]) 671 CPPFLAGS="$CPPFLAGS_SAVE" 672 # Ensure we can link against libmono-2.0 673 LIBS_SAVE="$LIBS" 674 LIBS="$MONO_LDFLAGS" 675 AC_CHECK_LIB([mono-2.0], [mono_runtime_invoke], [], [AC_MSG_ERROR([could not find libmono])], []) 676 LIBS="$LIBS_SAVE" 677 678 AC_SUBST([MONO_CFLAGS]) 679 AC_SUBST([MONO_LDFLAGS]) 680 fi 681 682 AC_SUBST([MONO_ENABLED]) 683 AC_SUBST([MONO_FILE]) 684 685 # =========================================================================== 639 686 # Detect if ruby is installed 640 687 # =========================================================================== -
trunk/zoo-project/zoo-kernel/request_parser.c
r790 r794 1627 1627 cgiFilePtr file; 1628 1628 int targetFile; 1629 char storageNameOnServer[2048];1630 char fileNameOnServer[64];1629 char *storageNameOnServer; 1630 char *fileNameOnServer; 1631 1631 char contentType[1024]; 1632 1632 char buffer[1024]; … … 1651 1651 break; 1652 1652 } 1653 fileNameOnServer=(char*)malloc((strlen(name) - t - 1 )*sizeof(char)); 1653 1654 strcpy (fileNameOnServer, name + t + 1); 1654 1655 1656 storageNameOnServer=(char*)malloc((strlen(path->value) + strlen(fileNameOnServer) + 2)*sizeof(char)); 1655 1657 sprintf (storageNameOnServer, "%s/%s", path->value, 1656 1658 fileNameOnServer); … … 1683 1685 cgiFormFileClose (file); 1684 1686 close (targetFile); 1687 free(fileNameOnServer); 1688 free(storageNameOnServer); 1685 1689 #ifdef DEBUG 1686 1690 fprintf (stderr, "File \"%s\" has been uploaded", -
trunk/zoo-project/zoo-kernel/service.c
r790 r794 515 515 free(tmp->value); 516 516 tmp->value=(char*)malloc((size+1)*sizeof(char)); 517 memmove(tmp->value,v,size*sizeof(char)); 517 if(v!=NULL) 518 memmove(tmp->value,v,size*sizeof(char)); 518 519 tmp->value[size]=0; 519 520 char sin[128]; -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r790 r794 81 81 #ifdef USE_PERL 82 82 #include "service_internal_perl.h" 83 #endif 84 85 #ifdef USE_MONO 86 #include "service_internal_mono.h" 83 87 #endif 84 88 … … 705 709 *eres = 706 710 zoo_ruby_support (&m, request_inputs, s1, &request_input_real_format, 711 &request_output_real_format); 712 } 713 else 714 #endif 715 716 #ifdef USE_MONO 717 if (strncasecmp (r_inputs->value, "Mono", 4) == 0) 718 { 719 *eres = 720 zoo_mono_support (&m, request_inputs, s1, &request_input_real_format, 707 721 &request_output_real_format); 708 722 }
Note: See TracChangeset
for help on using the changeset viewer.