WINDOWS Live Search

To contact me for any clarifications regarding any posts / information, please mail me at arijit [dot] basu [at] gmail [dot] com


Sunday, January 31, 2010

Review of: Microsoft Dynamics AX 2009 Programming: Getting Started

I had been super() busy since the last few weeks so i was unable to do some serious blogging. I however got time last week and read through the new AX book 'Inside Microsoft Dynamics AX 2009 Programming: Getting Started' by 'Erlend Dalen' and post my feedback.

"This is a very good book for beginners who want to explore the technical side of Microsoft Dynamics AX 2009 as well as for Functional consultants who want to know what goes behind the hood. The language is simple and easy to follow and there is a case study which can be referred and the solution to the case study 'Carz Inc.' is unravelled as you move through the chapters. One good thing I like about this book is the plenty of sample code and step by step guidance which will help novice AX developers to understand the concepts and apply in real world scenarios.


Chapter # 8 (Integrate with Standard AX) is also very nice and provides some information regarding the important API's which are required for Xmodule integration. There is plenty of sample code and entity diagrams for integration guidance. Considering the real world implementation scenario, this is an important chapter and has been well written.

Chapter # 9 (Creating a New Module) is also good for developers who want to create a new module in AX , just like the other AX standard modules and it walks the developer through number sequences, parameters, security aspects.


Chapter # 11 (Web Services) however deals with the old version of creating a web service (.asmx). In AX 2009 this framework has significantly changed to use WCF. You may want to refer to the latest AX 2009 SDK for AX 2009 AIF & WCF concepts. "



Overall this is a very nice book for new developers. Its definitely worth reading this book. Kudos Erlend.

Friday, January 15, 2010

AX on Cloud 9

Lately there has been a lot of activity related to cloud computing with introduction of Windows AZURE. It truly is an interesting technology providing businesses wider opportunities. Well I decided to explore AZURE a bit and did a small POC on AX integration with AZURE. Well I hit on many roadblocks but was able to overcome them. In my POC I have created a simple WCF service on AZURE Platform and I'm calling that service from AX. The steps are as follows:

1. Setup and configure the AZURE Development prerequisites.
AZURE Account can be obtained at http://windows.azure.com
It is important you download the AZURE Platform Training Kit from MSDN. Really helpful.
2. Create the AZURE WCF Service using Visual Studio 2008 or 2010.
I created a very simple service which accepts employee code and returns the credit rating.

When I went to deploy the service, I got an error and on further investigating I found that SQL Express is required . I was on SQL 2008. Well there is a workaround for this in case you are on SQL 2008. Open AZURE SDK Command Prompt and key in the following as shown and press enter. This will allow you to use SQL Server 2008 for your AZURE Developments.
DSInit /sqlInstance:. /forceCreate


3. Deploy the Service on the Cloud.
Use the demos and the instruction in AZURE Platform Training Kit to deploy the service in the cloud in the Production instance.
Browse the service by providing the service name on your browser. You will be able to see the service.

One important thing to notice here is that service name marked above in red.
This is something which will give you issues when you want to generate proxy using wcftestclient or svcutil and also with Dynamics AX :-). There is a hotfix available from Microsoft KB971842 . I could however not use this hotfix as I got an error while trying to install. Im on WIN 2008. Nevertheless the show must go on. My service was up in the cloud and I needed to now access it from AX.
4. Consume the service from AX 2009.
As with general wsdl files, in AX when you go to add a service reference using http://daxguy.cloudapp.net/Service1.svc, you will get an error as shown. There is a issue with AZURE wcf services and proxy generation :-(

Well the workaround is to use your local service http://localhost:50026/Service1.svc to generate the proxy in AX 2009 and then configure the Service Reference using the MS WCF Service Configuration editor to change the service reference. See the screenshot below.


This will change the config file in the Service References folder in your AX 2009 Application Instance folder.
Now write some code to call the service. I created a small form where I pass an employee code and get the credit rating of the employee. Just to be on the safe side, I shut down my local IIS server just to ensure that I was really referring to the cloud.

The code sample is as follows in AX 2009.
And it was working. Really cool. I was consuming a AZURE WCF Service from Dynamics AX. There is a lot of potential in this. Maybe in next generation AIF , developers will be able to generate Cloud AIF directly from AX :-).
I had also created a Windows Application to test this out in similar ways and it worked nicely.
Happy DAXing :-)