The E2E Bridge features the import of OData CSDL files describing an OData REST interface. The importer will generate the data (entities and types) and service elements to your xUML model. Refer to Importing OData Entities and Services for more information on the E2E OData importer.
After the import, you can call the OData REST service using the E2E REST Adapter.
Preventing Concurrent Updates Using ETag
OData features the usage of ETag to prevent concurrent updates. If wanting to update a record, you need to read it first. This read will provide you with an ETag. You need to pass this ETag with the request headers of your update/delete call. The request will only be performed, if the ETag has not changed meanwhile.
Calling OData Service Using ETag
- Read the record first.
- Make your modifications.
- Set the ETag provided in odata_etag to the request headers.
The ETag needs to be set in header "If-Match".
- Update the record.
If everything was fine, the update request will return with HTTP status code 2xx. If the record has been changed meanwhile, the request will return an error status.
Server Side Pagination via OData NextLink
OData features server side pagination. When requesting a collection of database items, the client will only get a first page of records and a so called "NextLink". This NextLink is stored in field odata_nextLink. Use this link for subsequent requests to get the next pages.
Calling OData Service Using odata_nextLink
- Read a page of records.
- Append the query result to the output structure.
- Check if there is a NextLink available.
- Set skiptoken from odata_nextLink.
Parameter skiptoken will instruct the OData service to skip the specified count of records (first to actual page) and return the next page of records.
- Repeat this until all search results are delivered (no NextLink available,
odata_nextLink = NULL).