473,804 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 .DefaultCredent ials, 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 2596
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.co m

"George" <go************ *****@spamgourm et.comwrote in message
news:11******** **************@ r29g2000hsg.goo glegroups.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 .DefaultCredent ials, 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
10505
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) - client works fine Scenario 2 ----------
0
1546
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 servers. My application keeps throwing a 401 Access Denied error. Most web sites say to set the proxy.Credentials property to “CredentialCache.DefaultCredentials” which works fine when I run the aspx page from my local IIS on my development...
6
2884
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 of them is ISA ... if i a not wrong), if yes how? Sameer
2
11434
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 out: I've a win32 service in C# on a client machine A, which accesses a WS (C#) on a server machine B (hosted on an IIS) Case 1: If I try to add the WSDL for the WS through VS2005, the 'Discovery
0
2120
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 consumes an external web service. It has passed a userid and password to a web proxy object to pass through our corporate proxy server and has been running fine for weeks. Our operations staff has just changed the proxy server so that it now...
1
15139
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 generated client class methods, we recieve the following error: "The remote server returned an unexpected response: (407) Proxy Authentication Required ( The ISA
0
1827
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 information it gets back to findout if it can connect to the service properly. If there is an error it will catch an exception and everything is fine. This used to work wonderfully, until somebody decided they needed to use a proxy server. (rats!) It's...
2
8187
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 407 Proxy Authentication Required. The same request through the old proxy succeeds. The same request to an HTTP address through the new proxy succeeds. Also, the request succeeds when forced to use Basic authentication but fails on NTLM.
2
5427
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 error :(407) Proxy Authentication Required ". Here is the code I am using, Please help me out at the earliest. public void JACCS_Response(string date,string jaccs_id,string irn,string company_id,string xmlid) { string...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10564
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10073
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9134
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7609
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.