• Honza Blaha
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hello,
i have long running callout on my visualforce page implemented via Continuation class. It works well in most cases, but sometimes (1 of 10 000 calls) there are two types of unexpected behavior.

1) oncomplete is not called after return from controller (processMoveToStage5Response method has run properly and response has been logged).

or

2) oncomplete is called but rerender is not performed, so activatedOrderResponseJson element's html on page is not rendered (but processMoveToStage5Response  processed response properly and response is logged).

Timeout for Continuation and WS is set to the same value (120 s).

Do you have an idea what can be cause of this behavior?

Thanks
Honza

Visualforce page:
<apex:form >
	<apex:outputPanel id="errorMessage" styleClass="hidden errorMessage">{!errorMessage}</apex:outputPanel>
	<apex:outputPanel id="activatedOrderResponseJson" styleClass="hidden activatedOrderResponseJson">{!activatedOrderResponseJson}</apex:outputPanel>

	<apex:actionFunction action="{!moveToStage5}" onComplete="onMovedToStage5()" name="startMoveToStage5" reRender="activatedOrderResponseJson,errorMessage" />

</apex:form>

Controller:
public Continuation moveToStage5() {
    Continuation cont = new Continuation(timeout);
    cont.continuationMethod = 'processMoveToStage5Response';

    AsyncWS.Asyncy_sf_webservice service = new AsyncWS.Asyncy_sf_webservice();
    activationResponse = service.method(cont, ... params ..);

    return cont;
}

public void processMoveToStage5Response() {
    AsyncWS.YSfSaveorderResponse_element response;
    try {
        response = activationResponse.getValue();
        //logging of response
    } catch(Exception e) {
        //logging of error
        return;
    }

    activatedOrderResponseJson = JSON.serialize(response);
}






 
Hello,
i have long running callout on my visualforce page implemented via Continuation class. It works well in most cases, but sometimes (1 of 10 000 calls) there are two types of unexpected behavior.

1) oncomplete is not called after return from controller (processMoveToStage5Response method has run properly and response has been logged).

or

2) oncomplete is called but rerender is not performed, so activatedOrderResponseJson element's html on page is not rendered (but processMoveToStage5Response  processed response properly and response is logged).

Timeout for Continuation and WS is set to the same value (120 s).

Do you have an idea what can be cause of this behavior?

Thanks
Honza

Visualforce page:
<apex:form >
	<apex:outputPanel id="errorMessage" styleClass="hidden errorMessage">{!errorMessage}</apex:outputPanel>
	<apex:outputPanel id="activatedOrderResponseJson" styleClass="hidden activatedOrderResponseJson">{!activatedOrderResponseJson}</apex:outputPanel>

	<apex:actionFunction action="{!moveToStage5}" onComplete="onMovedToStage5()" name="startMoveToStage5" reRender="activatedOrderResponseJson,errorMessage" />

</apex:form>

Controller:
public Continuation moveToStage5() {
    Continuation cont = new Continuation(timeout);
    cont.continuationMethod = 'processMoveToStage5Response';

    AsyncWS.Asyncy_sf_webservice service = new AsyncWS.Asyncy_sf_webservice();
    activationResponse = service.method(cont, ... params ..);

    return cont;
}

public void processMoveToStage5Response() {
    AsyncWS.YSfSaveorderResponse_element response;
    try {
        response = activationResponse.getValue();
        //logging of response
    } catch(Exception e) {
        //logging of error
        return;
    }

    activatedOrderResponseJson = JSON.serialize(response);
}