Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Error handling in methods exposed as AIF service

$
0
0

Hi

I have been programming a couple of methods/operations that are exposed via an Inbound Port as a service.

One of these methods contains a transaction that should either complete successfully or roll back and return additional information. Under normal circumstances, this would be an easy job using Try-Catch, Throw an Error, and in the catch-block gather the additional information’s.

However this been AIF it seems that the framework encapsulates the session in an outer transaction with its own “Try-Catch” and any Throw or TTSAbort is handled by this.

The problem is that in my case the “rollback” is actually a valid result and I just need to send back some other information to the calling part.

Anyone have any idea how to handle this?

I have thought of two myself but are interested in any outside comments:

  1. Instead of using regular Transactions in my method I could use UserConnections but that would be a massive job since there are multiple methods involved

  2. Have my caller take care of the error handling and if he encounter an Exception, catch that and call a different operation for the additional information. This sound most feasible but the error thrown from AIF will end up in the AX Exception log as an error and there will be quite many when we are running operation.

Thanks

Thomas

 


Viewing all articles
Browse latest Browse all 72043

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>