Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / July 2005

Tip: Looking for answers? Try searching our database.

configuration of web proxy credential use for HttpWebClientProtoco

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
asanford - 28 Jul 2005 15:26 GMT
Hello,

Is there a way to associate and set the credentials for a web proxy via the
config file?

We are writing a client program to access both web services (via
HttpWebClientProtocol subclasses) and direct web requests (via WebRequest
subclasses.)  In some cases, we need to go thru a WebProxy, and in other
cases, we go direct.  We are able to control this in the client's
configuration file (app.config or machine.config) via the optional
<defaultproxy> element, without any code changes (nice!)  However, if a given
configured web proxy requires non-anonymous access (that is, the proxy
returns "HTTP 407 - authentication required" errors), it seems we are
required to modify our code by setting the WebProxy.Credentials property
(perhaps to CredentialCache.DefaultCredentials.)  The question is this:
instead of doing this in code, is there a way, via the config file, to:
a) configure the client app configured web proxy to use or not to use some
credentials (instead of anonymous)
b) if the proxy is configured in (a) to use credentials, is there a way to
configure the credentials it should use ("default", or in other cases some
specific username/pwd)?

Any help would be much appreciated!  Thanks!
[MSFT] - 29 Jul 2005 03:42 GMT
Hello,

I am afraid that there is no such way to set the Credentials in config file
schema. We have to sepcify this in code. Anyway, you still can save it in
config file as customized value and read it out in your code and set the
value to the WebProxy.Credentials property. For example, with
AppSettingsReader Class:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemconfigurationappsettingsreaderclasstopic.asp

Luke
asanford - 29 Jul 2005 12:59 GMT
;(  oh well, thanks for the reply!

> Hello,
>
[quoted text clipped - 8 lines]
>
> Luke

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.