on 12-03-2013 2:02 PM
Hi,
I have created a service in Gateway. I get the results when I use GET for my url.
When I try to update the content using PUT method from Gateway client, i get the below error.
<?xml version="1.0" encoding="utf-8" ?>
</error>
I am using the same url which is used in GET, this gives me the exact line item of sales order which needs to be updated.
I have also implemented Update methods in the generated class.
Can anyone help me here?
Thanks,
Swetha
Hi Arun and Aakash,
Thanks for your reply.
I realized it after some trail and errors. I am able to trigger PUT now.
Thanks for the reply.
Regards,
Swetha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swetha,
You are in fact correct in attempting to do this, under the OData conventions it should be possible to update an entity via the navigation that you used to locate it. I had exactly the same issue and found that it was not supported.
Earlier versions of Gateway/SAP OData had a rule that you could only update an entity using its canonical URI, but that has since been relaxed. Not sure which SP release it was on but it might have been SP5. I have been able to perform navigation endpoint updates as a result of this change.
regards
Ron.
Hi Ron,
Are you sure you are able to do that now?
I have a latest GW system, but not able to do that.
Note 1574568 - SAP NetWeaver Gateway 2.0 - Known Constraints says
- No POST, PUT, DELETE, MERGE on navigation path.
- Updates are only allowed on the canonical URI. Reason is that the semantics are not clear. What do you modify? The association? The target entity? Both?
- POST possible as of SP4. Here the assumption is that you create both the target entity as well as the association.
Hi Krishna,
I think I was referring to the ability to do POST as in the above note.
I really do not understand why SAP say "Reason is that the semantics are not clear. What do you modify?". The URI contextualises the request, in all cases that I've wanted to use this (missing) feature. Other developers of non-SAP OData services have it, so how is it unclear in the SAP implementation? Sounds like smoke and mirrors, and also the fact that this feature would be difficult to implement on ( ) RFC generated services due to the inherent inflexibility of that modelling technique.
Thanks Ron for getting back.
Yeah, without this, I have to add parent IDs in child, so annoying and inefficient.
Your comments please. Also, do you think this feedback can be taken by SAP?
HI Swetha,
Please find the below links :
http://scn.sap.com/thread/3416603
https://scn.sap.com/thread/3424154
While get service fetch X_CSRF Token value apply the same for PUT.
Thanks,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swetha,
When you do a GET operation on the above said URL, you also get a URL using which you can do a PUT/DELETE operations. This URL is in the tag <id>, example:
<id>https<host>:<port>/sap/opu/odata/sap/ZICP_SO_SRV/SOItemSetItem(Pos='10',SOId='500000004')</id>
You should be using this URL to update your entity.
Best regards,
Aakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
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.