Changes between Version 31 and Version 32 of ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices
- Timestamp:
- Oct 16, 2010, 12:49:34 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices
v31 v32 517 517 Everybody should now get his own copy of the OGR Boundary Service stored as a ZOO Services Provider called ogr_ws_service_provider and deployed in the ZOO Kernel tree, so the following Execute request can be used to test the Service : 518 518 519 [http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=Boundary&DataInputs=InputPolygon=Reference@xlink:href= 519 [http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=Boundary&DataInputs=InputPolygon=Reference@xlink:href=http%3A%2F%2Flocalhost%3A8082%2Fgeoserver%2Fows%3FSERVICE%3DWFS%26REQUEST%3DGetFeature%26VERSION%3D1.0.0%26typename%3Dtopp%3Astates%26SRS%3DEPSG%3A4326%26FeatureID%3Dstates.15] 520 520 521 521 As you can see in the url above, we use an URLEncoded WFS request to the Geoserver WFS server available on OSGeoLive as a xlink:href key in the !DataInputs KVP value, and set the InputPolygon value to Reference. The corresponding non encoded WFS request is as follow : … … 525 525 Please note that you can add lineage=true to the previous request if you need to get information about the input values used to run your Service. Furthermore, you may need to store theExecuteResponse document of your ZOO Service to re-use it later. In this case you must addstoreExecuteResponse=true to the previous request. Note that is an important thing as the behavior of ZOO Kernel is not exactly the same than when running without this parameter settled to true. Indeed, in such a request, ZOO Kernel will give you an ExecuteResponse document which will contain the attribute statusLocation, which inform the client where the ongoing status or the final ExecuteResponse will be located. 526 526 527 Here is an example of what the ExecuteResponse using storeExecuteResponse=truein the request would look like :527 Here is an example of what the {{{ExecuteResponse}}} using {{{storeExecuteResponse=true}}} in the request would look like : 528 528 529 529 [[Image(Practical introduction to ZOO - 7.png,width=550px)]] 530 530 531 Then, according to the statusLocation, you should get the ExecuteResponseas you get before using the previous request. Note that can be really useful to provide some caching system for a client application.532 533 You didn't specify any ResponseForm in the previous request, it is not requested and should return a ResponseDocument per default using the application/json mimeType as you defined in you zcfg file. Nevertheless, you can tell ZOO Kernel what kind of data you want to get in result of your query adding the attribute mimeType=text/xml to your ResponseDocumentparameter. Adding this parameter to the previous request will give us the result as its GML representation :531 Then, according to the statusLocation, you should get the {{{ExecuteResponse}}} as you get before using the previous request. Note that can be really useful to provide some caching system for a client application. 532 533 You didn't specify any {{{ResponseForm}}} in the previous request, it is not requested and should return a {{{ResponseDocument}}} per default using the {{{application/json}}} {{{mimeType}}} as you defined in you zcfg file. Nevertheless, you can tell ZOO Kernel what kind of data you want to get in result of your query adding the attribute {{{mimeType=text/xml}}} to your {{{ResponseDocument}}} parameter. Adding this parameter to the previous request will give us the result as its GML representation : 534 534 535 535 [http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=Boundary&DataInputs=InputPolygon=Reference@xlink:href=http%3A%2F%2Flocalhost%3A8082%2Fgeoserver%2Fows%3FSERVICE%3DWFS%26REQUEST%3DGetFeature%26VERSION%3D1.0.0%26typename%3Dtopp%3Astates%26SRS%3DEPSG%3A4326%26FeatureID %3Dstates.15&ResponseDocument=Result@mimeType=text/xml] 536 536 537 As defined by the WPS specifications, you can also ask for a RawDataOutput to get only the data without the full ResponseDocument. To do that, you only have to replace the ResponseDocument of your request by RawDataOutput, like in the following request :537 As defined by the WPS specifications, you can also ask for a {{{RawDataOutput}}} to get only the data without the full {{{ResponseDocument}}}. To do that, you only have to replace the {{{ResponseDocument}}} of your request by {{{RawDataOutput}}}, like in the following request : 538 538 539 539 [http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=Boundary&DataInputs=InputPolygon=Reference@xlink:href=http%3A%2F%2Flocalhost%3A8082%2Fgeoserver%2Fows%3FSERVICE%3DWFS%26REQUEST%3DGetFeature%26VERSION%3D1.0.0%26typename%3Dtopp%3Astates%26SRS%3DEPSG%3A4326%26FeatureID %3Dstates.15&RawDataOutput=Result@mimeType=application/json] 540 540 541 Finally, please note that we go back to the default mimeTypeto directly obtain the JSON string as we will use this kind of request to develop our client application in the next section of this workshop.541 Finally, please note that we go back to the default {{{mimeType}}} to directly obtain the JSON string as we will use this kind of request to develop our client application in the next section of this workshop. 542 542 543 543 ===== Simplification and readability of request =====