Reading from internet–part 2
(This is the result of 1 hour per day auto-challenge as a full cycle developer)
After some searching, I have found this page https://bnro.ro/Cursurile-pietei-valutare-in-format-XML-3424.aspx where it says it has the latest BNR exchange rates in XML format – https://www.bnr.ro/nbrfxrates.xml – and it has also an xsd schema : https://www.bnr.ro/xsd/nbrfxrates.xsd ( Also I have discovered this page for mobile : https://bnro.ro/curs_mobil.aspx -to be discussed later)
So we have a XSD and a XML on internet – to be read into C# classes . Plain and simple, right ?
Step 1 (technical): From the XSD we should generate classes in C#. Searching on internet – found the first answer : https://www.liquid-technologies.com/online-xsd-to-cs-generator – not so good, since wants to have his own deserializer….
Trying the second options – found that I should launch VS Command – and put
xsd nbrfxrates.xsd /classes
Step 2(technical); Download the xml from the internet – use HttpClient
Step3(technical): Deserialize the JSON to see the data.
Step 4(technical): Deciding if exchange value should be float, decimal or double (http://net-informations.com/q/faq/float.html)
Step5(business): seeing multiplier ( currency multiplied by 100 )
And one hour passes…
Infovalutar
And one hour passes...(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
Leave a Reply