Child pages
  • RESTful Web Services
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Unknown macro: {sub-section}

Using the RESTful Web Service plugin business logic can be exposed as a RESTful Web Service.

The RESTful Web Service plugin does not contain any client side functions or properties, it is a 100% server side operating plugin.

To create a RESTful Web Service, all that is needed is to create a form in a solution and add the following methods to the form:

  • ws_read() for the GET operation
  • ws_create() for the POST operation
  • ws_delete() for the DELETE operation
  • ws_update() for the PUT operation

The RESTful Web Service API is published on the Servoy Application Server through the url: <serverUrl>/servoy-service/rest_ws/solutionName/formName

RESTful Web Services are to be stateless. As subsequent requests to the RESTful Web Service API might be handled by different headless clients in the pool of clients configured for the plugin, do not save any state. This means at least the following:

  • Do not use global or form variables
  • Do not use the solution model API
  • Do not alter the state of the a form's UI

For more information on RESTfull Web Services, see:
http://en.wikipedia.org/wiki/Representational_State_Transfer
http://www.infoq.com/articles/rest-introduction
http://www.ibm.com/developerworks/webservices/library/ws-restful/
http://home.ccil.org/~cowan/restws.pdf

In each method, the required business logic can be coded. Make sure all methods are stateless, thus do not rely on form and/or global variables, do not alter the solution blueprint using the solution model or change the state of forms as subsequent calls to the API can be handled by different headless clients.

A sample solution is included in the Servoy distribution (servoy_sample_rest_ws.servoy), detailing how to retrieve data from the http request and to return a response.

RESTful Web Services & [Servoy Cluster]

Be aware of the ....


Unknown macro: {table}

{column:width=80px}{column}{column}{column}

Unknown macro: {tr}
Unknown macro: {th}

Server Property Summary

Unknown macro: {tbody}
Unknown macro: {tr}
Unknown macro: {td}
Unknown macro: {tbody}
Unknown macro: {tr}
Unknown macro: {td}


Unknown macro: {table}

{column:width=100%}{column}

Unknown macro: {tr}
Unknown macro: {th}

Server Property Details

Unknown macro: {tbody}
Unknown macro: {tr}
Unknown macro: {td}
rest_ws_plugin_client_pool_exhausted_action
Unknown macro: {tr}
Unknown macro: {td}
Unknown macro: {sub-section}
Unknown macro: {sub-section}

Action when no more clients are availiable (block/fail/grow), default = block

Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

Parameters

Unknown macro: {sub-section}
Unknown macro: {div}
Unknown macro: {sub-section}
Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

Returns

Unknown macro: {sub-section}
Unknown macro: {sub-section}
Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

Also see

Unknown macro: {sub-section}
Unknown macro: {sub-section}
Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

External links

Unknown macro: {sub-section}
Unknown macro: {sub-section}
Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

Sample

Unknown macro: {sub-section}
Unknown macro: {sub-section}
Unknown macro: {tr}
Unknown macro: {td}
Unknown macro: {tbody}
Unknown macro: {tr}
Unknown macro: {td}
rest_ws_plugin_client_pool_size
Unknown macro: {tr}
Unknown macro: {td}
Unknown macro: {sub-section}
Unknown macro: {sub-section}

Max number of clients used (this defines the number of concurrent requests and licences used), default = 5

Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

Parameters

Unknown macro: {sub-section}
Unknown macro: {div}
Unknown macro: {sub-section}
Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

Returns

Unknown macro: {sub-section}
Unknown macro: {sub-section}
Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

Also see

Unknown macro: {sub-section}
Unknown macro: {sub-section}
Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

External links

Unknown macro: {sub-section}
Unknown macro: {sub-section}
Unknown macro: {builder-show}
Unknown macro: {tr}
Unknown macro: {td}

Sample

Unknown macro: {sub-section}
Unknown macro: {sub-section}
Unknown macro: {tr}
Unknown macro: {td}
  • No labels