WINDOWS Live Search

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


Tuesday, March 6, 2007

Consuming a Web Service in DAX 4.x

A 'nice to have' feature request made by a prospective client was the facility to download daily currency exchange rates in DAX. Fred Shen had blogged about this previously and it was my source for inspiration :).
What you need are the following:
-Currency Exchange Web Service : I have used http://www.webservicex.net/CurrencyConvertor.asmx
-Visual Studion2005 C# ( C# Program to access the Web Service and get the values)
-DAX :)

The code to access Web Service was written in C# {
I've started to get my hands dirty wid c# :)}



The
AXCurrencyExchange.dll was generated after building the C# project (The dll name may differ in your case). Copy the AXCurrencyExchange.dll to \Program Files\Microsoft Dynamics AX\40\client\Bin.
Start DAX 4.x.Open AOT, and locate the Reference node. Right click, select Add Reference and register the AXCurrencyExchange.dll in DAX. Then write the following code and run the code.



This is still in R&D phase and I'll work further when I get some more free time.
Looking for feedback, comments, queries and suggestions for improvements :)




3 comments:

~Drifter~ said...

WinINet net = new WinINet();
xmlpagetext=net.internetReadFile(net.internetOpenUrl(url));

XmlDocument = new XMLDocument2();
XMLDocument.loadXML(xmlpagetext);
XMLDocument.validate();


This will return the XML Doc, which can then be read, if thats whats required.

ijw said...

Where's the source for this? I have a C# screenscraper for www.x-rates.com that works much quicker than the web service you're using (at least, it did in my experiments) and I'd like to give it a go incorporating it...

Anonymous said...

Your blog keeps getting better and better! Your older articles are not as good as newer ones you have a lot more creativity and originality now keep it up!