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
Patrick Arkesteyn 2Patrick Arkesteyn 2 

Force.com IDE debug web services

Hi,

I'm a beginning Force.com IDE user. Great product !

I would like to debug a web service developed by other guys, who left the company. 
This is the code for the test class:

@isTest
private class WS01_Account_GetUpdate_TEST {
    
    private static testMethod void getAccountsTest() {
        Test.startTest();
        Account acc = testUtils.createAccount('testAccount');
        insert acc;
        
        DateTime dateTimeValue = DateTime.now().addMonths(-1);
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        req.requestURI = '/services/apexrest/Accounts/';
        req.httpMethod = 'GET';
        RestContext.request = req;
        RestContext.request.params.put('iRefDateTime', String.valueOf(dateTimeValue));
        RestContext.response= res;
        
        WS01_Account_GetUpdate.getAccountWithoutIdTEPORTAL();
        Test.stopTest();
    }
  }


My question is what to type in "Source to execute" in the "Execute Asynchronous" tab in Debug perspective.
I tried with:

new WS01_Account_GetUpdate_TEST().getAccountsTest();

But I'm getting :

Compile error at line 1 column 1
Type is not visible: WS01_Account_GetUpdate_TEST


Can anybody help me out here please ?

Many thanks in advance,

Patrick

@GM@GM
To debug, you should check the web service class - WS01_Account_GetUpdate.getAccountWithoutIdTEPORTAL();

To execute this test class in eclipse, please create test class suit config as mentioned in below doc
https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/runTests.htm
Patrick Arkesteyn 2Patrick Arkesteyn 2
Hi,

Apparently the way to go was using a Run Configuration.
Now I'm facing another problem: when stopping at a breakpoint, I don't see how to add a watch expression.
Is that impossible in Force.com IDE ?
@GM@GM
Yes you can do that.. Hope below doc will be helfull.. I use dev console to debug the code.
https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/debugger_overview.htm
Patrick Arkesteyn 2Patrick Arkesteyn 2

You can do a lot, but watch expressions are not supported.

Thanks anyway !