Changes between Version 62 and Version 63 of ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices


Ignore:
Timestamp:
Nov 2, 2010, 3:49:43 AM (13 years ago)
Author:
djay
Comment:

Add the section for GetStatus? service use

Legend:

Unmodified
Added
Removed
Modified
  • ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices

    v62 v63  
    620620
    621621If everything went well, you should get the Boundary of the JSON geometry passed as argument, and so be sure that your Service support both GML and JSON as input data. Note that in the previous request, we added a {{{mimeType}}} attribute to the {{{ComplexData}}} node to specify that the input data is not in the default {{{text/xml}}} {{{mimeType}}} but passed as an {{{application/json}}} string directly. It is similar to add {{{@mimeType=application/json}}} as we discussed before.
     622
     623===== storeExecuteResponse parameter and GetStatus Service =====
     624
     625If you go in your local {{{/home/user/zoows/sources/zoo-services/utils/status}}}, you'll find the code for a ServiceProvider which will provide the {{{GetStatus}}} service and the {{{longProcess}}} one. The last is a simple example to learn how to use the {{{status}}} variable from {{{lenv}}} section of the main configuration {{{maps}}} and the {{{updateStatus}}} function you have to call to take your status value into account. The main service providen is the {{{GetStatus}}} one, it is able to give you information about the current status value from a service running in background mode.
     626
     627You have to know that the ZOO Kernel will detect the presence of the {{{GetStatus}}} service and if it is available it will then return the link the corresponding {{{Execute}}} request.
     628
     629So now you will deploy the {{{GetStatus}}} and {{{longProcess}}} service on your local environment. As for each services, you shall be able to deploy the services simply by copying the {{{cgi-env}}} directory into your Apache {{{cgi-bin}}} directory. You can use the following command :
     630
     631{{{
     632#!sh
     633sudo cp ~user/zoows/sources/zoo-services/utils/status/cgi-env/*{zcfg,zo} /usr/lib/cgi-bin
     634}}}
     635
     636For simple Services it is the right way to deploy Service Providers. But in this specific case you'll have also to add some special parameter in the {{{main}}} section of you main configuration file and to copy an xsl file used to replace on the fly in the {{{ResponseDocument}}} the {{{percentCompleted}}} attribute of the {{{ProcessStarted}}} node returned by the {{{GetStatus}}} service.
     637
     638So first edit you {{{main.cfg}}} file to add the following lines in your main section :
     639
     640{{{
     641#!c
     642rewriteUrl=call
     643dataPath=/var/www/data
     644}}}
     645
     646Here you define the path where the service is able to find the xsl file, specified in the {{{dataPath}}} parameter. You also tell the ZOO Kernel that you want to use the rewriteUrl we defined in the [wiki:ZooWorkshop/FOSS4GJapan/UsingZooFromOSGeoLiveVM previous section].
     647
     648To finish your deploiement, you'll have now to copy the xsl file in the defined {{{dataPath}}} directory. You can use the following command :
     649
     650
     651{{{
     652#!sh
     653cp ~/zoows/sources/zoo-services/utils/status/cgi-env/*xsl /var/www/data
     654}}}
     655
     656Now, if you run the following request to run the service longProcess :
     657
     658[http://localhost/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=longProcess&DataInputs=&storeExecuteResponse=true]
     659
     660You shall get the a XML document looking like the following :
     661
     662'''Image Here'''
    622663
    623664=== Creating Services for other functions (!ConvexHull and Centroid) ===

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