I created a REST web service as below:
@RestResource(urlMapping='/v1/accounts/*')
global with sharing class REST_Account_Service_V1{
@HttpGet
global static Account doGet(){
RestRequest req=RestContext.request;
Account result=[select Id,Name,Phone,Website,AccountNumber FROM Account limit 1];
return result;
}
}
I have tested it with workbench and it is working fine. Now I want to consume this REST service in .Net application, the URL of my rest service is as below: https://ap5.salesforce.com/services/apexrest/v1/accounts
When I browse this URL on a browser, I got the below error:
I tried to consume that service in SOAP UI but it is showing the error session expired. I also tried to consume that service in console application in .Net but it is asking for username and password. I provided my salesforce username and password but no luck.I also tried with my system username and password but again no luck.
Please tell me the steps to consume REST service outside salesforce and within salesforce.
Thanks in advance !