Changes between Version 33 and Version 34 of ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices


Ignore:
Timestamp:
Oct 16, 2010, 12:55:36 AM (10 years ago)
Author:
djay
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices

    v33 v34  
    1717== Preparing ZOO metadata file ==
    1818
    19 A ZOO Service is a combination of a ZOO metadata file (.zcfg) and the runtime module for the corresponding implementation, which is commonly called ZOO Service Provider. We will first prepare a .zcfg file step-by-step. Please open your preferred text editor and edit a file named Boundary.zcfg in your /home/user/zoows/sources/zoo-services/ws_sp directory. First, you need to name the service between brackets at the top of the file, as the following:
     19A ZOO Service is a combination of a ZOO metadata file (.zcfg) and the runtime module for the corresponding implementation, which is commonly called ZOO Service Provider. We will first prepare a .zcfg file step-by-step. Please open your preferred text editor and edit a file named Boundary.zcfg in your {{{/home/user/zoows/sources/zoo-services/ws_sp directory}}}. First, you need to name the service between brackets at the top of the file, as the following:
    2020
    2121{{{
     
    3434Such metadata informations will be returned by a !GetCapabilities request.
    3535
    36 You can also add other specific informations like the processVersion. You can set if your ZOO Service can store its results, by setting the storeSupported parameter to true or false. You can also decide if the function can be run as a background task and inform on its current status, according to the statusSupported value :
     36You can also add other specific informations like the {{{processVersion}}}. You can set if your ZOO Service can store its results, by setting the {{{storeSupported}}} parameter to {{{true}}} or {{{false}}}. You can also decide if the function can be run as a background task and inform on its current status, according to the {{{statusSupported}}} value :
    3737
    3838{{{
     
    4444
    4545In the main section of the ZOO Service metadata file, you must also specify two important things:
    46  * serviceProvider, which is the name of the C shared library containing the Service function or the Python module name.
    47  * serviceType, which defines the programming language to be used for the Service. (value can be C or Python depending on what language you have decided to use)
     46 * {{{serviceProvider}}}, which is the name of the C shared library containing the Service function or the Python module name.
     47 * {{{serviceType}}}, which defines the programming language to be used for the Service. (value can be C or Python depending on what language you have decided to use)
    4848
    4949C !ServicesProvider Example :
     
    5454}}}
    5555
    56 In this case you will get an ogr_ws_service_provider.zo shared library containing the Boundary function, placed in the same directory than ZOO Kernel.
     56In this case you will get an {{{ogr_ws_service_provider.zo}}} shared library containing the Boundary function, placed in the same directory than ZOO Kernel.
    5757
    5858Python !ServicesProvider Example :
     
    6464}}}
    6565
    66 In this case, you will get an ogr_ws_service_provider.py file containing the Python code of your Boundary function.
     66In this case, you will get an {{{ogr_ws_service_provider.py}}} file containing the Python code of your Boundary function.
    6767
    6868In the main section you can also add any other metadata information, as the following:
     
    7777The main metadata informations have been declared, so you can now define data input which will be used by the ZOO Service. You can define any input needed by the Service. Please note that you can request ZOO Kernel using more data input than defined in the .zcfg file without any problem, those values will be passed to your service without filtering. In the Boundary Service example, a single polygon will be used as input, the one on which to apply the Boundary function.
    7878
    79 The data input declarations are included in a !DataInputs block. They use the same syntax as the Service itself and the input name is between brackets. You can also fill a title, an abstract and aMetaData section for the input. You must set values for the minOccurs and maxOccurs parameters, as they will inform ZOO Kernel which parameters are required to be able to run the Service function.
     79The data input declarations are included in a !DataInputs block. They use the same syntax as the Service itself and the input name is between brackets. You can also fill a title, an abstract and a {{{MetaData}}} section for the input. You must set values for the {{{minOccurs}}} and {{{maxOccurs}}} parameters, as they will inform ZOO Kernel which parameters are required to be able to run the Service function.
    8080
    8181{{{
     
    9191}}}
    9292
    93 The metadata defines what type of data the Service supports. In the Boundary example, the input polygon can be provided as a GML file or as a JSON string. Next step is thus to define the default and supported input formats. Both formats should be declared in a LitteralData or ComplexData block depending on their types. For this first example we will use ComplexData blocks only.
     93The metadata defines what type of data the Service supports. In the Boundary example, the input polygon can be provided as a GML file or as a JSON string. Next step is thus to define the default and supported input formats. Both formats should be declared in a {{{LitteralData}}} or {{{ComplexData}}} block depending on their types. For this first example we will use {{{ComplexData}}} blocks only.
    9494
    9595{{{
     
    107107}}}
    108108
    109 Then, the same metadata information must be defined for the output of the Service, inside aDataOutputs block, as the following:
     109Then, the same metadata information must be defined for the output of the Service, inside a {{{DataOutputs}}} block, as the following:
    110110
    111111{{{
     
    133133http://zoo-project.org/trac/browser/trunk/zoo-services/ogr/base-vect-ops/cgi-env/Boundary.zcfg
    134134
    135 Once the ZOO metadata file is modified, you have to copy it in the same directory than your ZOO Kernel (so in your case /usr/lib/cgi-bin). Then you should be able to run the following request :
     135Once the ZOO metadata file is modified, you have to copy it in the same directory than your ZOO Kernel (so in your case {{{/usr/lib/cgi-bin}}}). Then you should be able to run the following request :
    136136
    137137http://localhost/zoo/?Request=DescribeProcess&Service=WPS&Identifier=Boundary&version=1.0.0
     
    141141[[Image(Practical introduction to ZOO - 4.png,width=550px,nolink)]]
    142142
    143 Please note that the GetCapabilities and DescribeProcess only need a .zcfg file to be completed. Simple, isn't it ? At this step, if you request ZOO Kernel for an Execute, you will get an ExceptionReport document as response, looking as the following :
     143Please note that the GetCapabilities and DescribeProcess only need a .zcfg file to be completed. Simple, isn't it ? At this step, if you request ZOO Kernel for an {{{Execute}}}, you will get an {{{ExceptionReport}}} document as response, looking as the following :
    144144
    145145[[Image(Practical introduction to ZOO - 5.png,width=550px,nolink)]]

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png