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

Nov 2, 2010, 3:49:43 AM (10 years ago)

Add the section for GetStatus? service use


  • ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices

    v62 v63  
    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.
     623===== storeExecuteResponse parameter and GetStatus Service =====
     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.
     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.
     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 :
     633sudo cp ~user/zoows/sources/zoo-services/utils/status/cgi-env/*{zcfg,zo} /usr/lib/cgi-bin
     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.
     638So first edit you {{{main.cfg}}} file to add the following lines in your main section :
     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].
     648To finish your deploiement, you'll have now to copy the xsl file in the defined {{{dataPath}}} directory. You can use the following command :
     653cp ~/zoows/sources/zoo-services/utils/status/cgi-env/*xsl /var/www/data
     656Now, if you run the following request to run the service longProcess :
     660You shall get the a XML document looking like the following :
     662'''Image Here'''
    623664=== Creating Services for other functions (!ConvexHull and Centroid) ===


Context Navigation

ZOO Sponsors

Become a sponsor !

Knowledge partners

Become a knowledge partner

Related links