on ‎2020 Nov 21 7:57 AM
We are creating a custom oData service, and since the parameter might be long, we created it straight as a purely POST service via CREATE_DEEP_ENTITY method to handle all CRUD operations.
Functionality wise, it works as intended.
Aside from $metadata and all other built in GET calls, no GET method is implemented for each individual Entity Sets.
My worry is, would service callers implicitly call via GET first, even if the coding explicitly indicated a POST call?
Is this worry unfounded and it is alright to make this oData with only CREATE_DEEP_ENTITY implemented?
Thanks!
Request clarification before answering.
Hi Adrian,
technically it's possible to achieve that (as you already did).
Nevertheless that's not how anybody would expect an OData service to work. I would even say your service isn't an OData service as it doesn't fulfill the OASIS Open Data protocol requirements (e.g. each POST will either lead to an entity created on the backend or fail with an HTTP error).
I'm curious: What have the key aspects been for your choice to implement it this way?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Manfred. thanks for the feedback. Yes, it is more of a web service than an oData by definition and it is being consumed this way as well. As to why, mainly because it is a convenient way to create an end point, and POST, due to the possibility of large array of parameters(we dont want to make too many individual calls). It is just a read only function, but implemented as a POST due to this. Not sure though if absence of GET support would make some callers not work(in case they may do some implicit GET calls for whatever reason) with these calls waiting for response until timeout.
Hi Adrian,
Hi Gregor,
I agree with both of you. Implementing $batch would be the most OData compliant way to establish an "one entry end point". Although I as a client would expect that each call which can be made through a $batch can also be executed stand alone
Regarding your statement "with these calls waiting for response until timeout" -> I strongly recommend against letting such a request timing out with no response. Just use the "Not implemented" response via HTTP exception. Do you know about this possiblity or should I post an example?
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 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.