3

I am trying to invoke SOAP service using continuation. While I am able to successfully hit the service, my callback function is not called. Please help me know if there is any issue with it. Thanks

public Continuation doSave(){

    System.debug('request');
    Integer timeOut=20;//get form Custom Setting
    Continuation contObj=new Continuation(timeOut);
    contObj.continuationMethod='processResponse';
    Id entityIdentifier=policyRole.Id;
    String caseIdentifier='PolicyRoleUpdateForNewAccnt';
    AsyncPolicyManagementWebService.AsyncPolicyManagement_SOAP asynService=new AsyncPolicyManagementWebService.AsyncPolicyManagement_SOAP();
    PolicyManagementWebServiceSchema.PartyInput_Type payload=PolicyManagementWebServiceUtil1.getPartyInputType(entityIdentifier,caseIdentifier);
    asynService.JHHeader_request=PolicyManagementWebServiceUtil1.getRequestHeader(caseIdentifier);
    asynService.endpoint_x='http://policymanagement.getsandbox.com/Insurance/PolicyManagement_1.0';
    responseFuture=new AsyncPolicyManagementWebServiceSchema.UpsertPolicyPartyRole_response_elementFuture();
    responseFuture=asynService.beginUpsertPolicyPartyRole(contObj,policyNum,subDivisionId,subDivisionQualifier,subDivisionQualifierType,carrierAdminSystem,payload);

    return contObj;  
}

public Object processResponse(){
   System.debug('response');
   try{
     //response=new PolicyManagementWebServiceSchema.UpsertPolicyPartyRole_response_element();
     response=responseFuture.getValue();
     detailPageUrl=stdController.save();
     System.debug('page-'+detailPageUrl);
     System.debug(response);
     return detailPageUrl;
   }
   catch(Exception e){
     System.debug('Exception'+e.getMessage());
     return null;
   }
}
  • I assume you are calling doSave() from a Visualforce page? Can you add an extract from your page around how the method is called? Also, what do the Apex logs show during the callout and response? – Daniel Ballinger Nov 25 '15 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.