Guest User

Untitled

a guest
Feb 22nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. I'm trying to make callout using "Continuation" but the endpoint doesn't receive the request
  2. and I get the request like "Continuation-3".and I didn't get the response as well.
  3.  
  4. please check it once
  5.  
  6. Class :::
  7. ---------
  8.  
  9. public Object startRequest(String username,String password,String url,String accesstoken,String eventid) {
  10.  
  11. HttpRequest req = new HttpRequest();
  12. System.debug('UserName:::'+username+ ':' + 'Password::::' + password+ ':' + 'URL::::' +url+ ':' + 'AccessToken:::' +accesstoken+ ':' + 'EventId:::' +eventid);
  13. String url1 = 'https://xxxxxxxxx/api/xml?action=report-event-participants-complete-information&account-id=1319228412&session=apac1breezivz5ryh7ggboqkse&sco-id=1310582568';
  14.  
  15. req.setMethod('GET');
  16. req.setEndpoint(url1);
  17. Continuation con = new Continuation(60);
  18. con.state = con.addHttpRequest(req);
  19. con.continuationMethod = 'processResponse';
  20. requestLabel = con.addHttpRequest(req);
  21. this.requestLabel = con.addHttpRequest(req);
  22. System.debug('Request:::===='+requestLabel); // This line prints : Request:::====Continuation-3
  23. return con;
  24. }
  25.  
  26. public Object processResponse() {
  27. HttpResponse res = Continuation.getResponse(this.requestLabel);
  28. this.result = res.getBody();
  29. System.debug('Response:::'+result);
  30. if(res.getBody() != null && res.getStatusCode() == 200)
  31. XMLparserUpdate s = new XMLparserUpdate(res.getBody(),eventid,EventName);
  32. return null;
  33. }
  34.  
  35. Thanks
Add Comment
Please, Sign In to add comment