I\'m developing a Windows application to convert USD to INR. I know how to con
Here is the code piece: Add System.IO and System.Net and System.Xml
WebRequest webrequest =WebRequest.Create("http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=USD&ToCurrency=INR");
HttpWebResponse response = (HttpWebResponse)webrequest.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
XmlDocument doc = new XmlDocument();
doc.LoadXml(responseFromServer);
string value = doc.InnerText;
MessageBox.Show(value);
reader.Close();
dataStream.Close();
response.Close();
Conversion Rate is the right method to call. You can add a service method to your project. You may have to point it to the WSDL file. Make one call to get the base rate and then calculate the other rate by using 1/result of the first call.
If you don't want to add the service reference, you can also just request the page: http://www.webservicex.net/currencyconvertor.asmx/ConversionRate?FromCurrency=USD&ToCurrency=INR