문제

I have created an AIF service in dynamics AX 2012, when I tested it by calling the entrypoint method from a job, it worked fine, but when it is deployed en the calls are comming from the soap UI, it crashes inside with an error: "Unhandled esception".

While debugging I found out the unhandled exception is thrown inside my catch clause of my try catch statement.

It gets inside the catch because the method I am calling inside the try clause thows an error.

So does anyone know why I can catch thrown error when I am running the code on client using the job, but can't catch it while it runs in CIL on the server and the service is called from SoapUi?

도움이 되었습니까?

해결책

Solved,

AIF has one big transaction somewhere deep in the core code and an own try catch.

So when you throw an error inside AIF sevice it is going to abort the outer transaction and go to staight to the AIF catch clause, skipping all others.

That's why I couldn't catch it. Solution could be to commit AIF transaction, run your code and before return begin new transaction.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top