473,399 Members | 2,774 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,399 software developers and data experts.

configuration of web proxy credential use for HttpWebClientProtoco

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!
Nov 23 '05 #1
2 4997
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/de...us/cpref/html/
frlrfsystemconfigurationappsettingsreaderclasstopi c.asp
Luke
Nov 23 '05 #2
;( oh well, thanks for the reply!

"[MSFT]" wrote:
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/de...us/cpref/html/
frlrfsystemconfigurationappsettingsreaderclasstopi c.asp
Luke

Nov 23 '05 #3

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

Similar topics

2
by: aspguru | last post by:
I have been hunting around recently for reverse proxy solutions to work with IIS. An example use for this would be to put outlook web access on your multi host IIS box on port 80 or an application...
3
by: Robb Gilmore | last post by:
Hello, We have a C#.NET app which runs as a windows service. Periodically it needs to post information via the internet to a remote server. For the posting, we are using HttpWebRequest class....
0
by: George | last post by:
Hello, I'm running an ASPX application "WebApplication1" which consumes a web service (service1.asmx) hosted on a machine with IP (128.1.7.x) . The web service is located in the intranet. The...
0
by: George Bool | last post by:
Hello, I have a simple webservice that accepts a network credential as an argument to a webmethod. When i create a proxy for my client to use, the proxy generator then recreates a new type ...
4
by: Boni | last post by:
I want consuming a webserivce trough a proxy. I use this code. myService s = new myService (); System.Net.WebProxy proxyObject = new System.Net.WebProxy("http://proxyhost:8080"); s.Proxy =...
0
by: WSchaub | last post by:
Has anyone got any referece documentation on how to set the proxy credentials and set proxy server details in WCF proxies? Basically I want to do the following two scenarios we have done in pre-WCF...
0
by: ndskim | last post by:
Currently I have the Web Services Proxy code generated by the WSDL.Exe command line. My Web app consists of ASP.NET in VB 2005 version. Here is what I have in the sample code: ' Set Proxy...
3
by: Lance Wynn | last post by:
Hello, I am receiving this error when trying to instantiate a webservice component. I have 2 development machines, both are XP sp2 with VS 2008 installed. On one machine, the code works fine. On...
0
by: patelashlesh | last post by:
Hi, I want to upload my xml file ("test.xml") on to a specific URL. But I want some code snippet which helps me to by pass the proxy. I have used Net.WebClient to upload file,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
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.