02.05.2008, 13:08 | #1 |
Участник
|
dax-lessons: Get the Exchange Rates for the given Currency using X++
Источник: http://DAX-Lessons.spaces.live.com/B...FCD1!154.entry
============== I did MSN search and found a public web service; webservicex.net that provides a public currency converter web service. This code snippet accesses a public web service to get the exchange rate for a given currency using x++. X++: static void GetExchangeRates(Args _args) { com com = new com('microsoft.xmlhttp'); com com1; XMLDocument xmlDoc; Dialog exchDialog = new Dialog("Exchange Rates"); DialogField fromField; DialogField ToField; str url; ; fromField = exchDialog.addField(Types::String, 'Base Currency'); fromField.value(CompanyInfo::find().CurrencyCode); ToField = exchDialog.addField(Types::String, 'To Currency'); if(exchDialog.run()) { url = "http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?"; url += "FromCurrency=" +strupr(fromField.value())+"&ToCurrency="+strupr(ToField.value()); com.open("get",url, false); com.send(); com1 = com.responsexml(); xmlDoc = XmlDocument::newXml(com1.xml()); info("1 "+fromField.value() + " = " +xmlDoc.getNamedElement('double').text() + " " +ToField.value()); } } Источник: http://DAX-Lessons.spaces.live.com/B...FCD1!154.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
Теги |
blog, x++ |
|
|