473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Proxy credentials advice needed

My desktop application (C# 2.0) works just fine and makes tons of
requests via WebRequest and WebClient objects. However, users that are
behind Proxy servers are not able to use the app. I'm sure my head is
not right on this issue and i need to seek advice.

First, I dont really understand why I (the programmer) have to worry
about these details - shouldnt this be somewhere below me on the ISO
stack? But that sounds like complaining, so I'll stop right there.

Second, I dont know how I should handle this. Am i required to fetch
credentials from the user and store it locally? Can i get default
credentials from the OS (or IE)? Note: I have tried this using
CredentialCache.DefaultCredentials, but the values are always blank.

Code snippets would be very helpful and appreciated, but I really
would like to get your opinion on how this should be handled -
conceptually. It just doesnt add up (for me) that every application
that makes web requests, needs to handle this for itself... it should
be down in the OS somewhere (IMHO).

Thanks in advance,

George

Sep 13 '07 #1
1 2572
George,

No, it's really not below you. The mechanism that you are using for
generating http requests and responses is not something that is governed by
the system (.NET's implementation is from the ground up, and not through the
same mechanism that say IE uses) so you have to provide the ability to set
proxy information yourself if that is what is needed.

You basically have to get the credentials from the user (as well as the
address of the proxy sever, and any bypass addresses if you want to go that
far) and then use the WebProxy class to generate proxy information. You can
then set the Proxy property of your HttpWebRequest instance with the
WebProxy instance you created and the HttpWebRequest should use the proxy.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"George" <go*****************@spamgourmet.comwrote in message
news:11**********************@r29g2000hsg.googlegr oups.com...
My desktop application (C# 2.0) works just fine and makes tons of
requests via WebRequest and WebClient objects. However, users that are
behind Proxy servers are not able to use the app. I'm sure my head is
not right on this issue and i need to seek advice.

First, I dont really understand why I (the programmer) have to worry
about these details - shouldnt this be somewhere below me on the ISO
stack? But that sounds like complaining, so I'll stop right there.

Second, I dont know how I should handle this. Am i required to fetch
credentials from the user and store it locally? Can i get default
credentials from the OS (or IE)? Note: I have tried this using
CredentialCache.DefaultCredentials, but the values are always blank.

Code snippets would be very helpful and appreciated, but I really
would like to get your opinion on how this should be handled -
conceptually. It just doesnt add up (for me) that every application
that makes web requests, needs to handle this for itself... it should
be down in the OS somewhere (IMHO).

Thanks in advance,

George
Sep 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vladimir Rypacek | last post by:
Hi, I've got strange error on computer which is accessing web-service thrugh proxy. Scenario 1 ---------- - the web-service does not require authentication (Anonymous access is allowed) -...
0
by: Jim_H | last post by:
I am trying to set the Credentials property of my web service proxy and I cannot seem to get anything to work. I am calling a remote asmx page from an aspx and they each reside on different web...
6
by: sameer | last post by:
..NET Framework 1.1 VS2003 Application is making webservice calls from behind a proxy server and then freezes and dies. Questoin is can i use webservice over proxy server( i guess another name...
2
by: rcp | last post by:
Hi all, I've read all posts from all existing threads and none of them worked to solve my problem, although its exactly the same. I'll try to explain my case and see if a kind soul could help me...
0
by: J Ames | last post by:
Please, if this is the incorrect forum for this question, let me know which forum is most appropriate. I want to make sure I get visibility with the proper gurus! I have a .NET console app that...
1
by: khubieb | last post by:
Situation: We have to connect to a 3rd party XML Web Service outside our LAN by adding a WCF Service Reference to a simple console application Problem: When attempting to invoke any of the...
0
by: Maxx57 | last post by:
C# VS.Net 1.1 (2003) - trouble with using IE proxy server settings I've got a program that detects if it can connect to a webservice. It sends a System.Net.WebRequest and then checks the...
2
by: =?Utf-8?B?TGVuc3Rlcg==?= | last post by:
A C# (.NET 2) application which uses the System.Net.HttpWebRequest object to request a resource over HTTPS is failing following the installation of a new proxy server on our internal network with...
2
by: krishnakrish | last post by:
Hi, My name is krishna. I am using asp.net 2.0 with C#. I amusing Windows XP professional as OS. When I post some data to an external web server I get the error as "The Remote server returned an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.