web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Custom AIF Service throws Exception

(0) ShareShare
ReportReport
Posted on by 725

We have created a custom Service in AX 2012 that allows for PickListRegistration to be completed via AIF.  When the AIF jobs are run I am getting the error message:

The reqeust failed with the following error:  Exception of type 'Microsoft.Dynamics.Ax.Xpp.InvalidRemoteCallException' was thrown.

I have tried to debug the classes that are run, as well as the AIF processing jobs, but nothing stops.  Where do I need to look and what do I need to look for in order to figure out what is causing this error and correct it?

Thank You in advance,

Joe

*This post is locked for comments

I have the same question (0)
  • Brandon Ahmad Profile Picture
    2,465 User Group Leader on at

    Remote call exceptions are usually due to failure to communicate with the service that you are calling.  WCF Endpoint configuration is a common cause for this.  

    Have you already done this?

    msdn.microsoft.com/.../jj710372.aspx

  • Brandon Ahmad Profile Picture
    2,465 User Group Leader on at

    Let me know if this turned out to be an endpoint configuration issue.  Sometimes, AIF services don't give errors.  In that case, we can pull out the big guns and go with WCF which has a rich, troubleshooting framework.  I'll walk you through how to use it if you don't have things fixed.

  • joederoche Profile Picture
    725 on at

    I was not able to get the debugger to work.  I'm not sure where else to loo.

  • Verified answer
    joederoche Profile Picture
    725 on at

    After finally getting the Debugger to connect to the Service Code and subsequently being able to step through the code, I could see that there was code that was being called that referenced a Form Datasource.  Obviously that can not exist in an AIF service.  So I commented that code out and the service works like a charm. It seems as though when this type of error is thrown, it is because of a throw error(@SYS....) in the code and it is expected to return to a client, when there wasn't one.

  • Brandon Ahmad Profile Picture
    2,465 User Group Leader on at

    Joederoche, thank you for sharing your solution to this problem.  It will help a lot of people.  There is one more mystery to this puzzle.  Why did the debugger not catch that initially?  Did something change?  My first suggestion was to look at the debugging process.  Then, if that couldn't find anything, we would have to go deeper into the WCF troubleshooting to find out what was really happening.  

    But I'm glad you solved it and good job.  Thanks for posting the solution.  

  • sanjsuh Profile Picture
    25 on at

    Hi Brandon,

    I have a similar problem. I have a custom service that's hosted on IIS. i have also developed a custom exception framework that handles the exceptions.However, this code however, never executes.

    custom service code looks like:

    try

    {

    //process

    }

    catch(Exception::Error)

    {

    //Handle Exception

    }

    catch(Exceptoin::CLRError)

    {

    //Handle Exception

    }

    Exception of type Microsoft.Dynamics.Ax.Xpp.ErrorException is thrown every time the debugger hits Catch block.

  • Suggested answer
    SilvanoD Profile Picture
    285 on at

    Hi Sanjuh,

    We had a similar issue.  Please see my findings at www.axdeveloperconnection.it/.../custom-aif-services-wrapped-gigantic-transaction

  • Suggested answer
    Community Member Profile Picture
    on at

    I'm having a similar error when trying to use a web service to attach files to ax 2012 R2. I tested the function using a jobb and found that the issue was because the transaction to update DocuRef table was not enclosed in ttsBegin{}ttsComit; After correcting that, the job can now perform file attachments, but the web service is still throwing the same error from .net C#. What else do I need to do?

  • SilvanoD Profile Picture
    285 on at

    Hey Joe,

    That was a good call on looking in to the transaction scope.  Next thing you'll need to do if the class works in X++ execution but not via services is to use the Build menu to generate a Full CIL Compilation.  This will update the service objects in your /Server/Bin/XppIL/ folder on the AOS. If your interface or data contracts have changed, you'll want to update/refresh the Service Reference in Visual Studio as well.

    Cheers,
    Lane

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans