on 06-04-2015 10:23 AM
Hi,
I am building an Odata model for a rest service
Rest Service is URI:
http://localhost:8080/javaservice/webresources/notification
The above service is a POST service hence I wanted to create a "Create" connection in the Odata model using custom coding.
The SMP version is 3.0 SP06 and using Eclipse Kepler for OData modeling and the Api toolkit for SMP version is 1.4.1.
With the above information following are the 2 errors that I am seeing
1. When creating the OData model in Eclipse if I select "Target runtime as SP06" then when the Model is created and I perform "Select Data Source" and select "Rest Service" as data source and select "Create" then Finish button gets disabled and shows "Operation is not supported". But if the Target runtime is SP07 then it allows.
I have followed Carlos Roggan's blog and not sure why for SP06 its not allowing me to do a "Create" operation.
2. For now I have created a Odata model for the above rest webservice using "Query" operation and added the Service as a Endpoint to SMP application.
SMP Hybrid Application Endpoint URL is :
https://shbsm2.groupc.net:8083/gateway/odata/SAP/RESTSERVICETEST;v=3
When I am trying to access the Odata model using the below URL via POST
http://localhost:8087/com.lehigh.test/NotificationObjSet
or
http://shbsm2.groupc.net:8087/com.lehigh.test/NotificationObjSet
I have passed necessary headers
Authorization
X-SMP-APPCID
X-CSRF-Token
Along with the POST payload. The SMP does the authentication and its successful but after that doesnt connect to the above service and gives and error response "403 Access to the specified resource has been forbidden."
Any suggestions will be helpful.
Regards,
Amit
Hi Amit,
1) With latest release SMP3 SP07 server, SMP supports full CRUD on REST data source. Till SMP3 server SP06 only query and read were supported. Read here
2).How come you doing a POST for Query operation? I don't get it.
<<Please hide all your company related info host name, ip address>>
Upgrade to SP07 to take advantage of full features of REST services.
Regards,
JK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks JK for quick response.
So as I understand with SMP SP06 I will not be able to do POST operation on rest service and that is the reason 403 error is coming.Please confirm.
I was trying to figure out if POST works through query operation since in the blog the Create operation was enabled for SP06. I got confused with that.
In SP06, you can do only READ and QUERY for REST service data source. With SP07 release it is fully supported. Check below SAP note
Hi JK,
I am working on SMP with SP09. When I am calling the odata from adroid app or postman it is giving me 403 forbidded error when I am using POST operation. Is there any setting in SMP or do I need to pass anything else to the request. We dont have any CSRF tokens.
Thanks in Advance,
Siva Kumar
Hi Siva,
For any POST operation there are few parameters that needs to be sent, CSRF token is one of them.
Can you please provide more details about how you are trying to connect via Rest Client [screenshots].
Also POSTMAN application has some issue and I have faced the similar problems with that. I have used Advance Rest Client on Chrome.
Regards,
Amit
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
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.