+ Start a Discussion
basha skbasha sk 

Keeping the Refresh page untill callout complete?


Hi All,


I'm trying to use the Continuation process in my apex for keeping the calls untill callout complete.But Here endpoint doesn't executed

This line prints all details :  System.debug('UserName:::'+username1+ ':' + 'Password::::' + password1+ ':' + 'URL::::' +url1+ ':' + 'AccessToken:::' +accesstoken+ ':' + 'EventId:::' +eventid);        

This line doesn't executed :  req1.setEndpoint(url1+'/api/xml?action=report-event-participants-complete-information&account-id=1319228412&session='+accesstoken+'&sco-id='+eventid);                      
I checked in debug logs.

 public Object startRequest(String username1,String password1,String url1,String accesstoken,String eventid) {
     
        Continuation con = new Continuation(30);
        con.continuationMethod='processResponse';
        Http http = new Http();
        HttpRequest req1 = new HttpRequest();
        Blob headerValue = Blob.valueOf(username1 + ':' + password1);
        System.debug('UserName:::'+username1+ ':' + 'Password::::' + password1+ ':' + 'URL::::' +url1+ ':' + 'AccessToken:::' +accesstoken+ ':' + 'EventId:::' +eventid);        
        String authorizationHeader = 'BASIC ' +  EncodingUtil.base64Encode(headerValue);
        req1.setHeader('Authorization', authorizationHeader);
        req1.setMethod('GET');
        req1.setEndpoint(url1+'/api/xml?action=report-event-participants-complete-information&account-id=1319228412&session='+accesstoken+'&sco-id='+eventid);                      
        res = http.send(req1);
        System.debug('Test Endpoint Request');
        this.requestLabel_1 = con.addHttpRequest(req1);
        return con;        
        
    }
    
    public Object processResponse(){          
        HttpResponse response1 = Continuation.getResponse(this.requestLabel_1);
        System.debug('Test1::'+response1);       
        if(response1.getBody() != null && response1.getStatusCode() == 200)        
        XMLparserUpdate s = new XMLparserUpdate(response1.getBody(),eventid,EventName);        
        return null;
 }
 
 Thanks