[SalesForce] while calling Apex REST class, getting response “Could not find a match for URL /CallREST1″,”errorCode”:”NOT_FOUND”}]”

here is my APEX REST class code

@RestResource(urlMapping='/CallREST1')

global with sharing class CallREST { @HttpPost global static String createNewCase(String companyName) { System.debug('COMPANY: '+companyName); return 'done'; } }

my HTTP request code is


HttpRequest req = new HttpRequest();
req.setHeader('Authorization', 'OAuth ' + accessToken);
req.setHeader('Content-Type','application/json');
req.setHeader('accept','application/json');
 req.setEndpoint(instance_url+'/services/apexrest/CallREST1');
 req.setBody('{"companyName":"GenePoint"}');
 req.setMethod('POST');
 HttpResponse res =new Http().send(req);

please point me out where i am wrong..
i don't have any namespace, package name.
i have tried with appending Organization name or Organization ID , as i found from somewhere to try all this things..
any help is appreciated.

Best Answer

This is a known issue. According to Rich Unger, the solution may be to "Run All Tests" or click the "Compile All Classes" link in the Apex class list. Take a look at this blog post and the comments at the bottom of the page for more info.