+ Start a Discussion
Darshee MehtaDarshee Mehta 

Test class for a webservice

Hi, I would need some help to write a test class for a webservice
Here WCT_LCA__c is my custom object.

global class WCT_UpdateLCARecordsFlags {
   
    WebService static String updateFlags(String recordId)
    {
        system.debug(recordId);
        WCT_LCA__c rec;
        try{
            rec=new WCT_LCA__c(id=recordId);
            rec.WCT_Updated_Fragomen_record__c=false;
            update rec;
       
        }Catch(Exception e)
        {
       
        }
       
        return 'Thanks for reviewing the LCA record.';
       
    }

}
Sonam_SFDCSonam_SFDC
Hi Darshee,

I'd suggest you should start writing the webservice test class looking at the examples available in the following links:
http://salesforce.stackexchange.com/questions/22735/custom-webservice-test-class
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_callouts_wsdl2apex_testing.htm

If you face any issues with the code, please post here and the community will be able to help you better.
Darshee MehtaDarshee Mehta
Thank you Sonam