function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nishad BashaNishad Basha 

give the Example of Sample HelloWorld WebService class in salesforce?

KaranrajKaranraj
Here is the webservice article link which contains step by step prodecures - https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts

Are you looking for example on custom apex webservice ? Here is the sample code for the webservice.
The following sample illustrates a simple web service. The service accepts the name of a queue as a string, and returns a collection of Cases that are currently assigned to that queue. This is done by defining a "global" class and a "webService" method.
global class CasesWebService {
	
    webService static Case[] getCasesForQueue(String queueName) {
    	QueueSobject q = [SELECT Id FROM QueueSobject WHERE Queue.Name = :queueName];
    	Case[] cases = [SELECT Id, Subject, Reason, Status FROM Case WHERE OwnerId = :q.Id];
        return cases;
    }
    
}



 
Nishad BashaNishad Basha
Hi, Karanraj

How to write the above scenario using visualforce page?
KaranrajKaranraj
Do you want to connect salesforce to the external system? what is the exact scenario you are looking for the sample program?