on 2020 Nov 18 2:40 AM
I intent to use a CAP service as source for HANA SDI.
HANA successfully creates the virtual table, the replication table and the stored procedure necessary to kick off the synchronization. Once I kick it off, I receive the following error:
internal error: Remote execution error org.apache.olingo.client.api.communication.ODataClientErrorException: (null) Missing format for representation kind 'ENTITY_COLLECTION' [HTTP/1.1 406 Not Acceptable] for query ...
After some debugging I found that SDI seemingly sends the header 'Accept: application/json;odata.metadata=full ' as part of the request and CAP does not like it (see output section below).
So the questions are:
To test/reproduce the scenario in an even simpler environment I assembled the following:
data model (schema.cds)
namespace riz.test;
entity Workorder{
key test: String;
description: String(300);
}
service (admin.cds)
using {riz.test as my} from '../db/schema';
service SampleOdataService{
entity Workorder as projection on my.Workorder;
}
Test script (test.http)
GET http://localhost:4004/sample-odata/Workorder HTTP/1.1
Accept: application/json;odata.metadata=full
### Write Data
POST http://localhost:4004/sample-odata/Workorder HTTP/1.1
Content-Type: application/json
{
"test": "6d3488f5-25a0-4643-8efe-cadcce54516a",
"description": "hello world"
}
Output
GET /sample-odata/Workorder
[2020-11-18T02:24:51.696Z | WARNING | 1866982]: No matching content type found for representation kind 'ENTITY_COLLECTION' and accept 'application/json;odata.metadata=full'
[2020-11-18T02:24:51.697Z | WARNING | 1866982]: Missing format for representation kind 'ENTITY_COLLECTION'
[2020-11-18T02:24:51.698Z | WARNING | 1866982]: No matching content type found for representation kind 'ERROR' and accept 'application/json;odata.metadata=full'
Request clarification before answering.
The "workaround" is the OData V2 Proxy for CAP.
Once I add the proxy to the deployment and switch the URL and version in the SDI Odata adapter it runs successfully.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin,
the CAP backend only supports "application/json;odata.metadata=minimal" which is the default format according to the OASIS OData standard. The format parameter odata.metadata=minimal can also be omitted. metadata=full is NOT supported by the SAP backends on the ABAP/JAVA and Node stack. The "minimal" format is also better from a performance perspective and as lower memory footprint.
Hope that helps.
Regards Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It helps and I agree. Can you let the SDI Odata Adapter team know that they should not use metadata=full as default as they do right now? I unfortunately don't have an option of changing it to minimal in the adapter which now brings me back to my problem that CAP and SDI Odata don't work together (at least not for V4).
User | Count |
---|---|
52 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.