+ 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?