on 2018 Aug 20 4:19 PM
Hi I have created successfully (with SAP HANA Web-Based Development Workbench) a table in "Catalog" and then I'have created a package on "Editor" where I have configured a xsodata file to define the service. I test it and works the GET method but not POST one. The only place where the crud methods are defined is in xsaccess file and both methods are defined there ("cors": { "enabled":true, "allowMethods": ["GET","POST","DELETE","PUT"],). So I dont find the error. Do anyone know a step by step tutorial to implement CRUD operation with oData Service with
SAP HANA Web-Based Development Workbench on SAP Coud Platfom.
Thanks
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
It would be great if you could add the error message you get to your question. I assume, you simply did not set the x-csrf-token header.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your answer.
I get 403 forbidden error. I test POST method as follow (with postman):
- run GET method for individual entity by ID (https://dbs00*******83trial.hanatrial.ondemand.com/test/service.xsodata/Documents(DOCUMENT_NUMBER='1000000001',SAP_SD_DOCUMENT_NUMBER='1000000001')),
- copy/paste the response in request body of POST method changing the ID value with new value and run the request (https://dbs00*******83trial.hanatrial.ondemand.com/test/service.xsodata/Documents).
Here the complete xsaccess file:
{ "exposed" : true, "authentication" : { "method": "Form" }, "cache_control" : "must-revalidate", "cors": { "enabled":true, "allowMethods": ["GET","POST","HEAD","OPTIONS"], "allowOrigin": ["*"], "maxAge":"3600" }, "enable_etags" : false, "force_ssl" : false, "prevent_xsrf" : true }
User | Count |
---|---|
56 | |
10 | |
8 | |
8 | |
6 | |
6 | |
5 | |
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.