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)

AX 2012 R2 AIF Inbound Port - Exception

(0) ShareShare
ReportReport
Posted on by

Hi,

based on a query for two tables I have created the AIF documents and classes with the „AIF Document Service Wizard“.

I have only implemented the create-operation.

I also created an Inbound port based on a file-adapter for this service.

When I try to import a valid xml file, I get the following AIF-exception:

„The request failed with the following error:  

Unable to cast object of type 'Dynamics.Ax.Application.AxCommon' to type 'Dynamics.Ax.Application.AxMyTableName.“

Subsystem: AifInboundProcessingService-processRequest

Does anyone have an idea on what to do?

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Try to debug the code to see where the wrong type is coming from. See Walkthrough: Debugging AIF Service Operation Calls When Using File System Adapter, if needed.

  • Suggested answer
    Lukas Havrda Profile Picture
    on at

    Hi,

    it's a long time you posted this question. I have been dealing with the same issue so I will post my solution, so that it may help anybody in the future.

    The cause of the error in my case was, that a <MyTableName> was too long and when AX generated an AX<MyTableName> class, it cut the class name to something like "AXMyTableNam". This must have been the problem because when I shortened the table name and regenerated the AX<MyTableName> class (using Ax menu > Tools > "AIF" > Update document service), it solved the issue.

    MSDN most probably specifies that by saying: "Each Ax <Table> class has a one-to-one relationship with a database table. This relationship is reflected in the naming convention for Ax <Table> classes. Names are constructed by prefixing the table name with Ax. For example, the Ax <Table> class for the SalesTable table is AxSalesTable." (https://technet.microsoft.com/cs-cz/library/aa873749.aspx).

    I had to change the new class name in all occurences in the code as well and had to re-register the my document service.

    I hope this may help somebody if needed.

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