I want to upload an XML file on the Internet to a DataTable in C #. XML is downloaded from http://rates.fxcm.com/RatesXML and looks like this:
<?xml version="1.0" encoding="UTF-8"?> <Rates> <Rate Symbol="EURUSD"> <Bid>1.29174</Bid> <Ask>1.29198</Ask> <High>1.29407</High> <Low>1.28723</Low> <Direction>-1</Direction> <Last>14:56:48</Last> </Rate> <Rate Symbol="USDJPY"> <Bid>82.862</Bid> <Ask>82.885</Ask> <High>83.293</High> <Low>82.847</Low> <Direction>1</Direction> <Last>14:56:47</Last> </Rate> </Rates>
Can I use the ReadXml method of the DataTable class to read XML or do I need some kind of http request to wrap it in a string?
EDIT: I just wrote the following
public DataTable GetCurrentFxPrices(string URL) { DataSet ds = new DataSet("fxPrices"); ds.ReadXml(URL); }
and he is trying to read the data, but I'm behind the corporate firewall. I really don't know how to get around this. I get this error:
System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
In firefox, I have an HTTP proxy with a port number. Can I install this somewhere in my application?
source share