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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Retrieve AIF message id during service call

(0) ShareShare
ReportReport
Posted on by

Hi guys,

I have a question regarding the use of custom services in Ax 2012. We are working at a client who has a .NET front office system and our Ax 2012 back office system. We have a lot of custom services to create/read/update/delete data from Ax.

The problem:

Because we have so many services and so many calls happening, it's very difficult to locate the origin of a problem. When, for example, an update went wrong, it's very difficult to retrieve the exact call that handled the update. We need this call to verify if the problem comes from the front office (providing us wrong data) or in Ax (handling the data wrong).

Question:

Is there any way to retrieve the AIF Message id during the call, so that we can store this data somewhere as a sort of logging system?

*This post is locked for comments

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

    You talk about custom services, but what you're describing sounds more like document services. Can you please confirm which ones you mean?

  • Ben Maes Profile Picture
    on at

    Hi Martin, we use custom services.

  • Martin Dráb Profile Picture
    239,932 Most Valuable Professional on at

    So what do you mean by a message ID of a custom service?

  • Ben Maes Profile Picture
    on at

    Hi Martin,

    These calls are logged in the following path:

    System Administration > Periodic > Services and application integration framework > History

    In this form, we can see all the calls that we received from the front office. It has a unique identifier (field Message Id). At the moment, when there is an issue, we try to find the relevant message in this overview by searching the specific call (service port and service operation) + the time when the call was done. If we can find the specific call, we can use the document log to view the XML and to check whether we received the wrong data from the front office OR if there is a problem in Ax.

  • Martin Dráb Profile Picture
    239,932 Most Valuable Professional on at

    It seems that you're using the file system adapter, correct? Unfortunately I don't use using custom services with adapters, so I don't know how exactly it behaves.

    Wouldn't enabling "Respond after error in asynchronous request" solve your problem?

  • Ben Maes Profile Picture
    on at

    We use the NetTcp adapter.

    The error handling is one thing, but it's not always an error. Sometimes we just get invalid data from a business perspective, not invalid as in wrong type or something. So we then want to go back and look where we got the data from. Did we get the wrong values from Front Office or did we handled the data wrongfully in Ax. Being able to link a record update to a AIF Service Call (by using the Message id) would make it a lot more simpler to detect and ultimately fix the problem.

    As i understand it, you can actually provide the message id (guid) through the call context. So an alternative solution would be to let the Front Office set the message id and expand our datacontract with a new parameter (message id).

  • Martin Dráb Profile Picture
    239,932 Most Valuable Professional on at

    Interesting - I've never heard about anybody doing that. If there is an error, we return a fault message, if it's not an error and we just need to log extra information, we log whatever we need in any way we need. I've never used any message ID with synchronous web services. And I don't think you can do it inside your service operation anyway - what you get is the contract object, nothing else.

    Let's assume that getting the message ID is possible. What would you do with it? Store it in database when updating a record?

  • Ben Maes Profile Picture
    on at

    We have database logging activated on the "critical" tables, so we can always see who changed it and when. The idea would be to store the reference (message id) as well, so we can see for every update to which message id it is linked. That way, we can easily find the service call and find the document log.

  • Martin Dráb Profile Picture
    239,932 Most Valuable Professional on at

    In that case, I think your best chance is indeed extending you data contracts.

  • Community Member Profile Picture
    on at

    Hi Ben,

    Have you find the solution for this?

    Thanks

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans