on 11-05-2014 7:18 AM
hi,
i m trying to consume odata service through mbo following the guide (http://scn.sap.com/docs/DOC-33172/diff?secondVersionNumber=4), but i am getting an error while testing the service in preview as "The request URI is not valid. The segment 'EmployeeSet' refers to an entity set and not to a single entity'".
thanks
Hello Das,
Its not advised to disable the CSRF Token and fire ur modifying requests.
Use ur metadata URL of ur service and fetch the token by adding the header x-csrf-token - fetch.
U will get the token value in the response header and use that value when u fire ur Update Operation with the header x-csrf-token - <fetched_value>
However u can disable as specified below :
Cross-Site Request Forgery Protection - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Ashwin,
i am not able to create mbo by giving the value of CSRF token which i have fetched from rest client's response. can you help me out with that.
the service is same
http://devgw.ltisap.com:8005/sap/opu/odata/sap/ZEXP_REQ_SRV/EXPREQ_SET
Thanks.
Hello Das,
I do not have knowledge on how u can create an MBO that uses GW Services.
All i can try is to give u info regarding what all is required to fire ur GW Service.
Use the below URL and fetch the CSRF Token.
Add header x-csrf-token : fetch
Use HTTP Method GET.
http://devgw.ltisap.com:8005/sap/opu/odata/sap/ZEXP_REQ_SRV/$metadata
U will get the token value in the response header.
Now use that value in x-csrf-token header and fire ur UPDATE service with the HTTP Method PUT.
The data which u would like to update will go as part of ur payload.
Regards,
Ashwin
Hello Das,
Can u please share the url which u r using ? Please cross check the url again.
U need to send the EntitySet name in the URL not the Entity name.
https://xxxxx/sap/opu/odata/sap/DEMO_SRV/EmpEntitySet
Here EmpEntitySet is a Entity Set name. This is how u need to address ur GW service.
Please check this.
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
http://devgw.ltisap.com:8005/sap/opu/odata/sap/ZODATA_HWCMBO_SRV/EmployeeSet%28%27000000009%27%29
i think i m using the entity set name only. which is EmployeeSet .
Please fire as below.
If its a QUERY ->
http://devgw.ltisap.com:8005/sap/opu/odata/sap/ZODATA_HWCMBO_SRV/EmployeeSet?$filter=<property_name>; eq '000000009'
If its a READ ->
Where <property_name> is the name which u would have defined/maintained in ur GW model for the Employee Number.
hi,
i am not able to put any input parameter . It is giving me above mentioned error.
That is why i have created a new service which gives only one parameter as output and takes no input.
but still it is not working. Can you help me out with this.
new service (http://devgw.ltisap.com:8005/sap/opu/odata/sap/ZODATA_HWCMBO_SRV/EmployeeSet)
Hello Das,
Its very strange that ur not able to put any parameter as input. It make no sense if u r not able to send any input.
The URL's which i shared are the standard GW URL's and it should work.
Can u try as below :
http://devgw.ltisap.com:8005/sap/opu/odata/sap/ZODATA_HWCMBO_SRV/EmployeeSet?$top=1
Regards,
Ashwin
hi Ashwin,
i am able to consume the following oData service according to the steps mentioned in the document. i have consumed it by get method.
http://devgw.ltisap.com:8005/sap/opu/odata/sap/ZEXP_REQ_SRV/EXPREQ_SET
Right now i m trying to consume one oData service for update through mbo. Do you have any document for that?
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.