Changeset 794 for trunk/docs/services
- Timestamp:
- Dec 27, 2016, 6:34:38 PM (8 years ago)
- File:
-
- 1 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 ----------
Note: See TracChangeset
for help on using the changeset viewer.