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.Crea te("http://msdn.microsoft. com/rss.xml");
bool useProxy =
Boolean.Parse(S ystem.Configura tion.Configurat ionSettings.App Settings["usePro
xy"]);
if(useProxy)
{
string address, port, username, password, domain;
address =
System.Configur ation.Configura tionSettings.Ap pSettings["address"];
port = System.Configur ation.Configura tionSettings.Ap pSettings["port"];
username =
System.Configur ation.Configura tionSettings.Ap pSettings["username"];
password =
System.Configur ation.Configura tionSettings.Ap pSettings["password"];
domain =
System.Configur ation.Configura tionSettings.Ap pSettings["domain"];
WebProxy myProxy = new WebProxy(addres s, Int32.Parse(por t));
myProxy.BypassP roxyOnLocal = true;
NetworkCredenti al myCred = new NetworkCredenti al(username, password,
domain);
myProxy.Credent ials = myCred;
objRequest.Prox y = myProxy;
}
WebResponse objResponse = objRequest.GetR esponse();
oSR = new StreamReader(ob jResponse.GetRe sponseStream()) ;
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_P LEASEtkachenko. com> wrote in message
news:Ox******** ******@TK2MSFTN GP12.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