Hi Oleg,
sad to say, this lokks true. Anyway, it's not too much code, but eveythings
is too new for me .....
With help of MSDN/SDK I made the following working successfully:
//+++ excerpt
StreamReader oSR = null;
WebRequest objRequest =
WebRequest.Create("http://msdn.microsoft.com/rss.xml");
bool useProxy =
Boolean.Parse(System.Configuration.ConfigurationSe ttings.AppSettings["usePro
xy"]);
if(useProxy)
{
string address, port, username, password, domain;
address =
System.Configuration.ConfigurationSettings.AppSett ings["address"];
port = System.Configuration.ConfigurationSettings.AppSett ings["port"];
username =
System.Configuration.ConfigurationSettings.AppSett ings["username"];
password =
System.Configuration.ConfigurationSettings.AppSett ings["password"];
domain =
System.Configuration.ConfigurationSettings.AppSett ings["domain"];
WebProxy myProxy = new WebProxy(address, Int32.Parse(port));
myProxy.BypassProxyOnLocal = true;
NetworkCredential myCred = new NetworkCredential(username, password,
domain);
myProxy.Credentials = myCred;
objRequest.Proxy = myProxy;
}
WebResponse objResponse = objRequest.GetResponse();
oSR = new StreamReader(objResponse.GetResponseStream());
oDS.ReadXml(oSR);
//--- excerpt
Anyway, thanks for your help. My sample above is from a code, where a
DataSet is used, while I use XmlDocument. But I am shure, I can adapt the
one or two lines of code to use XmlDocument!
Best regards,
Manfred
"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
Manfred Braun wrote:
and thanks for your posting. After studying this document, I found, that
it does'nt resolve my problem going through a proxy-server. It would apply,
to specify creadentials to the destination. But in my case, the
destination-url is accessibly publicly and I have to deal with our proxy....
Yeah, you are right, that's not enough.
So you have to deal directly with WebRequest class. There are two ways
I'm aware of - direct one and elegant one. Former - create WebRequest,
set up its proxy property, get WebResponse and load XmlDocument from
response's stream.
More elegant way - encapsulate above WebRequest/WebResponse logic into
custom reusable XmlResolver.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel