on 12-06-2016 10:36 PM
Hello,
I implement a Odata V4 service with Apache Olingo V4.0.
When I call this service with the read method of an ODataModel in UI5. I get an answer and no error but the oData Object in the success funktion is empty (undefined).
Only the respone.body is filled with the response :
{"@odata.context":"$metadata#Categories","value":[{"ID":1,"Name":"Notebook Basic 15","Description":"Notebook Basic, 1.7GHz - 15 XGA - 1024MB DDR2 SDRAM - 40GB"},{"ID":2,"Name":"1UMTS PDA","Description":"Ultrafast 3G UMTS/HSDPA Pocket PC, supports GSM network"},{"ID":3,"Name":"Ergo Screen","Description":"17 Optimum Resolution 1024 x 768 @ 85Hz, resolution 1280 x 960"}]}
Is it a problem that the @odata.context is only $metadata#Categories and not http://localhost:8080/odata/$metadata#Categories
var oModel = new sap.ui.model.odata.ODataModel("/odata",true);
oModel
.read(
"Categories",
{
filters : null,
async : false,
success : function(oData, response) {
var x = oData;
var y = response;
},
failed : null
});
The deprecated sap.ui.model.odata.ODataModel and the recommended sap.ui.model.odata.v2.ODataModel support OData V2 services only.
For OData V4 services use sap.ui.model.odata.v4.ODataModel. See e.g. OData V4 Model on SAPUI5 SDK (always refers to the latest release) for more information on the usage and existing restrictions (check in the documentation for your release).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.