Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Texo/JSON REST Web Services

< Texo
Revision as of 04:00, 3 April 2012 by Unnamed Poltroon (Talk) (Response Model)

Introduction

Texo JSON web services allow you to connect client-side user interfaces to a standard JPA enabled web container. The client side can be based on a RIA library such as [1]] or a mobile web solution. In the future also RCP clients will be supported.

The Texo JSON web service support uses the Texo runtime libraries.

The Texo JSON webservice support the following operations:

  • Retrieve using GET http requests: using queries, requesting individual objects, all instances of a type
  • Delete operation through the HTTP Delete method
  • Update and Insert through POST/PUT

On each request Texo returns a structured response based on a schema. The response contains retrieved data, metadata (like record count), updated objects and result information.

Response Model

The response model is defined by this ecore file. There are 3 types which can be returned:

  • ErrorType: returned when an error occurs, it contains a message, stacktrace and additional information
  • ResponseType: is returned for a retrieval/GET operation for a set of objects
  • ResultType: is returned for a delete/update/insert operation, it returns the complete objects that have been deleted, inserted or updated.

Update/delete/insert operations can be executed for multiple objects in one is executed for multiple objects in one request. One request is always executed in one transaction, if one record fails, the operation also fails for the other records and an ErrorType response is returned with a HTML 500 status code.

When a request is done for a single record, like this:

http://localhost:8080/texo/jsonws/library%7CWriter/1

Then the record/object is returned as it is, so no special ErrorType/ResponseType/ResultType is returned.

{"books":[],"_eclass":"library|Writer","db_version":1,"db_Id":1,"_id":"1","name":"name0","_title":"name0"}

Test Tools

Insert/Update Operation

Retrieve - Individual - Paging

Delete Operation

Error Response

Back to the top