A
Andrew
Morning everybody,
I have an XML document located on a web address and I wish to create a
C# program to read that XML document and process it - which shouldn't
be that difficult yet I'm running into all kinds of problems because
I'm behind a firewall.
After much searching I found using WebProxy, NetworkCredentials and
HttpWebResponse/Request to be quite useful but again it's not really
working the way I'd like. So I decided to setup a prototype using the
three classes above so I could get them working.
For example...
HttpWebRequest HttpWReq =
(HttpWebRequest)WebRequest.Create("http://homepage.com/");
WebProxy objProxy = new WebProxy("1.2.3.4");
NetworkCredential myCred = new NetworkCredential("user", "pass",
"domain");
// a few more lines of code here
Console.WriteLine(HttpWebResp.StatusDescription);
which outputs "OK" and that's fantastic - at least I know my proxy is
setup right.
But if I change the WebRequest.Create from "http://homepage.com" to
"http://homepage.com/filename.xml" it generates a 404 error; but the
file is there.
Any ideas?
I have an XML document located on a web address and I wish to create a
C# program to read that XML document and process it - which shouldn't
be that difficult yet I'm running into all kinds of problems because
I'm behind a firewall.
After much searching I found using WebProxy, NetworkCredentials and
HttpWebResponse/Request to be quite useful but again it's not really
working the way I'd like. So I decided to setup a prototype using the
three classes above so I could get them working.
For example...
HttpWebRequest HttpWReq =
(HttpWebRequest)WebRequest.Create("http://homepage.com/");
WebProxy objProxy = new WebProxy("1.2.3.4");
NetworkCredential myCred = new NetworkCredential("user", "pass",
"domain");
// a few more lines of code here
Console.WriteLine(HttpWebResp.StatusDescription);
which outputs "OK" and that's fantastic - at least I know my proxy is
setup right.
But if I change the WebRequest.Create from "http://homepage.com" to
"http://homepage.com/filename.xml" it generates a 404 error; but the
file is there.
Any ideas?