
I have a custom AX service operation that can take 5+ minutes to complete and I'm trying to figure out how to abort it from my .NET application, but aborting the client doesn't seem to do anything?
The problem is if I call the operation and the service times out, the AX operation continues on until completion, so I lose visibility to the results (success/failure). An example being a long-running posting operation where I don't know if it posted successfully or not.
I've created a simple demo app where I can't seem to get the operation to abort. In the below code I just create a transaction (ttsbegin/ttscommit), insert into a table at start, sleep, insert into table at end.
I would suggest a different approach. One problem seems to be in the fact that you service client makes a synchronous call of a long-running operation and keeps waiting for many minutes. Getting into a timeout is the expected result, and it looks wasteful even without it.
And then you want to kill a fully working posting just because of how you've designed your integration. The result would be really bad - your service would become unusable, because it wouldn't be able to do the posting.
The solution for this problem is running the service asynchronously. It means that you start the operation and don't wait for a result. Later you'll either make a request to check the result, or you'll implement a notification from AX to your system.
By the way, I see no "below code".