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
richfer_richfer_ 

How to write test method for web service method?

How to write test method for the following web service method?

 

 public String resetPassword(Long contactId,String userName,String passWord,Integer updatedBy) {
            serviceFlorenceWeaComNew.resetPassword request_x = new serviceFlorenceWeaComNew.resetPassword();
            serviceFlorenceWeaComNew.resetPasswordResponse response_x;
            request_x.contactId = contactId;
            request_x.userName = userName;
            request_x.passWord = passWord;
            request_x.updatedBy = updatedBy;
            Map<String, serviceFlorenceWeaComNew.resetPasswordResponse> response_map_x = new Map<String, serviceFlorenceWeaComNew.resetPasswordResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              ...
            );
            response_x = response_map_x.get('response_x');
            return response_x.return_x;
        }

Best Answer chosen by richfer_
souvik9086souvik9086

You can check here

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_callouts_wsdl2apex_testing.htm

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks