I configured a REST service with the Services module and created a custom service with the CRUD + index functions. If I call the index function like so localhost/drupal/blog/note, it gives me the correct output. But if I call the retrieve function like so localhost/drupal/blog/note/2, I just get ["Access denied for user anonymous"]. The retrieve function should just return the id that is passed in the path, which is 2 in this example. I don't have any authentication enabled for my service. I also turned on all available permissions for the anonymous user to see if it works but that did not help.
So what could be the problem?
problem say ur not authorized person means you need to login to system first then hit the url you will get the result in browser..
$cookie_session = "$session_name=$sessid";
curl_setopt($curl, CURLOPT_COOKIE, "$cookie_session");
this will you will set your session and you will able to use CRUD function.
You need to give the access for "Anonymous User"(If you want to access your service output through Anonymous User) too, for the content view/edit/delete (which is required), for the same node type which you are going to access through your web service in Drupal 7.
Either you need to first login and you can view if you have required permissions.