• Dan Cobb 9
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies

Hello,

I am trying to use Continuation for the first time and am hitting a strange error. Below is a simple page I created with both a Synchronous Callout and a Continuation Callout button. When, in my developer org, I press the "Synchronous Callout" button, I get a response as expected. When I press the "Continuation Callout" button I get an error, "Apex class 'ApexPage.ContinuationController' does not exist". Have you seen this? Do I not understand Continuation?

Page:

<apex:page controller="ContinuationController" showChat="false" showHeader="false" sidebar="false" id="pg">
	<apex:pageMessages id="frmMsgs"/>	
	<apex:form id="pgFrm" >
		<apex:commandButton action="{!testSyncCallout}" value="Synchronous Callout" reRender="frmMsgs"/>
		<apex:commandButton action="{!testContinuationCall}" value="Continuation Callout" reRender="frmMsgs"/>
	</apex:form>	
</apex:page>
 

Controller:

public with sharing class ContinuationController {
	
    private String returnedContinuationId;
    private String baseSericeURL = '<Im not telling you my url!>';

	public ContinuationController() {}

	public void testSyncCallout() {
        HttpResponse testResponse = new HttpResponse();
        HttpRequest testRequest = new HttpRequest();
        HTTP HTTPService = new HTTP();
        testRequest.setMethod('GET');
        testRequest.setEndpoint(baseSericeURL);
        testRequest.setTimeout(60000);
        testResponse = HTTPService.send( testRequest );
        ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.INFO,  testResponse.getStatusCode() + ': ' + testResponse.getStatus() + ' '+ testResponse.getBody()) );
    }

    public Object testContinuationCall() {
        //Timeout in seconds, 60 is limit
        Continuation con = new Continuation(60);
        //Set callback method
        con.continuationMethod='testContinuationCallback';
        //Create callout request
        HttpRequest req = new HttpRequest();
        req.setMethod('GET');
        req.setEndpoint(baseSericeURL);
        returnedContinuationId = con.addHttpRequest(req);
        return con;
    }

    public Object testContinuationCallback() {
        //Get the response by using the unique label
        HttpResponse httpRes = Continuation.getResponse(returnedContinuationId);
        ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.INFO,  httpRes.getStatusCode() + ': ' + httpRes.getStatus() + ' '+ httpRes.getBody()) );
        //Return null to re-render the original Visualforce page
        return null;
    }
}


Error Message:
User-added image

I am creating my first site. It will contain a single Visualforce page. The page is using a case field set. The page worked fine, I was able to access it throught the site url and test it's functionality. I added a new field to the field set, and I now get the generic, "Authoriziation Required" page when I navigate to the site url. I remove the field from the field set and can view the page as before.

My first thougth is that it's field level security around that field that is causing the problem. When I go to the field accessibility for the field in question, I see no entry for the site profile at all. I can find no other way to change field level security for that field, or even view what the accessibility is for my site profile. What am I missing? Or am I way off base?

Thanks,
Dan

Hello,

I am trying to use Continuation for the first time and am hitting a strange error. Below is a simple page I created with both a Synchronous Callout and a Continuation Callout button. When, in my developer org, I press the "Synchronous Callout" button, I get a response as expected. When I press the "Continuation Callout" button I get an error, "Apex class 'ApexPage.ContinuationController' does not exist". Have you seen this? Do I not understand Continuation?

Page:

<apex:page controller="ContinuationController" showChat="false" showHeader="false" sidebar="false" id="pg">
	<apex:pageMessages id="frmMsgs"/>	
	<apex:form id="pgFrm" >
		<apex:commandButton action="{!testSyncCallout}" value="Synchronous Callout" reRender="frmMsgs"/>
		<apex:commandButton action="{!testContinuationCall}" value="Continuation Callout" reRender="frmMsgs"/>
	</apex:form>	
</apex:page>
 

Controller:

public with sharing class ContinuationController {
	
    private String returnedContinuationId;
    private String baseSericeURL = '<Im not telling you my url!>';

	public ContinuationController() {}

	public void testSyncCallout() {
        HttpResponse testResponse = new HttpResponse();
        HttpRequest testRequest = new HttpRequest();
        HTTP HTTPService = new HTTP();
        testRequest.setMethod('GET');
        testRequest.setEndpoint(baseSericeURL);
        testRequest.setTimeout(60000);
        testResponse = HTTPService.send( testRequest );
        ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.INFO,  testResponse.getStatusCode() + ': ' + testResponse.getStatus() + ' '+ testResponse.getBody()) );
    }

    public Object testContinuationCall() {
        //Timeout in seconds, 60 is limit
        Continuation con = new Continuation(60);
        //Set callback method
        con.continuationMethod='testContinuationCallback';
        //Create callout request
        HttpRequest req = new HttpRequest();
        req.setMethod('GET');
        req.setEndpoint(baseSericeURL);
        returnedContinuationId = con.addHttpRequest(req);
        return con;
    }

    public Object testContinuationCallback() {
        //Get the response by using the unique label
        HttpResponse httpRes = Continuation.getResponse(returnedContinuationId);
        ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.INFO,  httpRes.getStatusCode() + ': ' + httpRes.getStatus() + ' '+ httpRes.getBody()) );
        //Return null to re-render the original Visualforce page
        return null;
    }
}


Error Message:
User-added image