axaptax++dynamics-ax-2012dynamics-ax-2012-r2aif

Dynamics Ax 2012 R2 AIF services refresh takes too long a time


I found that, during development, where multiple deployments occur for the same service, the AIF services get disrupted and you get cryptic errors when you access the inbound ports. You can refresh the AIF services by opening the AIF Services form (AOT, Forms, AIFServices) and clicking the Refresh button. It takes about 15 minutes to finish.

Any ideas on why it takes so long and what it actually does?

Thank you.


Solution

  • The AifServices form refreshes all declared services and that takes a lot of time.

    We changed the form, so that only the selected service is refreshed. This is the changed code for \Forms\AifService\Designs\Design\[ActionPane:ActionPane]\[ActionPaneTab:ActionPaneTab]\[ButtonGroup:ButtonGroup]\Button:Register\Methods\clicked:

    void clicked()
    {
        // <SingleServiceRefresh>
        DialogButton dialogButton;
        // </SingleServiceRefresh>
    
        super();
    
        // <SingleServiceRefresh>
        dialogButton = Box::yesNoCancel('Click Yes to update all services. No to refresh only the selected.', DialogButton::Cancel);
        if (dialogButton == DialogButton::No)
        {
            AifServiceGenerationManager::registerService(aifService.Name);
        }
        else if (dialogButton == DialogButton::Cancel)
        {
            return;
        }
        else
        // </SingleServiceRefresh>
        {
    
            startLengthyOperation();
            AifServiceGenerationManager::registerServices();
            aifService_ds.executeQuery();
            aifService_ds.research();
            endLengthyOperation();
        }
    }