0
Answer

Need help with getting XML feed

Dejan Djokovic

Dejan Djokovic

17y
1.6k
1
When I try to  get data from some XML feed  using  this code:

WebRequest reguest = HttpWebRequest.Create(uri);
StreamReader stream = new    StreamReader(reguest.GetResponse().GetResponseStream());
FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
StreamWriter sw = new StreamWriter(fs);
sw.Write(stream.ReadToEnd());
stream.Close();
sw.Close();
fs.Close();

As result I get file that contains something like this:

Hy{m jI"t?7I~wiwW}u5[-O$[ox >c:}i7}qwM[ugiT?&9_?[N^Zzo?5tFh(`x*<`S~e:!pP{G?y? <??~ge|.29Nw.uy ?2f ?) "&`_9%44[wLu[v/mw~z}"30<{EdK/f?XzB~0O O_GzE/z}S{?:[px%
$`$`U]*M?u?DLt~"k8y:Zwq?    'Y8>wG?:'o

With another XML feed the resulting file is OK.

Can anybody help me?