Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I'm trying to make callout using "Continuation" but the endpoint doesn't receive the request
- and I get the request like "Continuation-3".and I didn't get the response as well.
- please check it once
- Class :::
- ---------
- public Object startRequest(String username,String password,String url,String accesstoken,String eventid) {
- HttpRequest req = new HttpRequest();
- System.debug('UserName:::'+username+ ':' + 'Password::::' + password+ ':' + 'URL::::' +url+ ':' + 'AccessToken:::' +accesstoken+ ':' + 'EventId:::' +eventid);
- String url1 = 'https://xxxxxxxxx/api/xml?action=report-event-participants-complete-information&account-id=1319228412&session=apac1breezivz5ryh7ggboqkse&sco-id=1310582568';
- req.setMethod('GET');
- req.setEndpoint(url1);
- Continuation con = new Continuation(60);
- con.state = con.addHttpRequest(req);
- con.continuationMethod = 'processResponse';
- requestLabel = con.addHttpRequest(req);
- this.requestLabel = con.addHttpRequest(req);
- System.debug('Request:::===='+requestLabel); // This line prints : Request:::====Continuation-3
- return con;
- }
- public Object processResponse() {
- HttpResponse res = Continuation.getResponse(this.requestLabel);
- this.result = res.getBody();
- System.debug('Response:::'+result);
- if(res.getBody() != null && res.getStatusCode() == 200)
- XMLparserUpdate s = new XMLparserUpdate(res.getBody(),eventid,EventName);
- return null;
- }
- Thanks
Add Comment
Please, Sign In to add comment