on 03-28-2018 9:52 PM
Hello,
I have a simple demo situation with:
my files are:
xsodata:
service{
"DB"."CA01" as "Ca01";
...
}
xsaccess:
{
"exposed": true,
"authentication": [{
"method": "Form"
}],
"mime_mapping": [{
"extension": "jpg",
"mimetype": "image/jpeg"
}],
"force_ssl": false,
"enable_etags": true,
"prevent_xsrf": true,
"anonymous_connection": null,
"cors": [{
"enabled": false
}],
"cache_control": "no-cache, no-store",
"default_file": "index.html"
}
I use an odata model with sapui5 for action on the package.
When I read (GET) it's ok, when I create (POST) it's ok (the data are written succesfully), when I update (PUT) I have the answer:
{ "error": { "code": "", "message": { "lang": "en-US", "value": "The URI is not valid for PUT operation. The URI must point to a single resource for PUT operations."}}}
with a status code:
405 Method Not Allowed
With create or update I'm using the same js obj:
var saveObj = {
KEY1: 1,
KEY2: 1,
KEY3: 1,
VALUE1: 'something',
...
}
the odata create call is:
odataServ.create('Ca01', saveObj, null, function (odata, resp) {
console.log(odata);
console.log(resp);
});
the odata update call is:
odataServ.update('Ca01', saveObj, null, function (odata, resp) {
console.log(odata);
console.log(resp);
});
As you can see the only difference is the method.
obviusly I try to update after the create is done, the row appear in the table, the keys are populated, the sapui5 app is reloaded and other basic test.
If somebody can help me I will really appreciade
Hello,
Your answer is right, if I read the __metadata url is written in this way. My mistake.
The answer from the server is:
500 Internal Server Error
{ "error": { "code": "", "message": { "lang": "en-US", "value": "Service exception: [7] feature not supported"}}}
That is a better answer but not the solution 😞
How can I activate this feature in hana xsodata service?
Anyway, thank you for your answer!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error is saying that you can not call method put to Ca01 which represents multiple entities. You must set the path to a specific entity.
odataServ.update('Ca01(THE ID)', saveObj,null,function(odata, resp){
console.log(odata);
console.log(resp);});
Regards,
Jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.