And thought i would make an attempt to make an Windows Service that calls Dynamics AX and gets some data back from it.
For now the code is really simple, just the bare minimum, connect to Dynamics AX, call a class and receive the result in a string.
But its a good starting point, so any thing can really be build on top of it.
Download Visual Studio 2010 code ( link )
Three things you have to remember in Visual Studio, i have done it in the project but you might need to check on the reference.
- Add a reference to Microsoft.Dynamics.AX.ManagedInterop.dll file, its usually found in the sub of your Dynamics AX installation under \BusinessConnector\Bin\
- Change the Target Framework to .Net Framework 2.0
- Change the Platform Target to x64 (So this code will only work on a 64bit machine)
As a help to make this i used the code Eitan Mizrahi put in the question on the forum, and this Youtube video on making a Windows Service in Visual Studio ( link )
I hope you can use this code, and feel free to leave a comment with suggestions for what i should change, or anything you would like me to look at next.