473,785 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

configuration of web proxy credential use for HttpWebClientPr otoco

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
HttpWebClientPr otocol 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.Creden tials property
(perhaps to CredentialCache .DefaultCredent ials.) 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 5012
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.Creden tials property. For example, with
AppSettingsRead er Class:

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemconf igurationappset tingsreaderclas stopic.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.Creden tials property. For example, with
AppSettingsRead er Class:

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemconf igurationappset tingsreaderclas stopic.asp
Luke

Nov 23 '05 #3

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

Similar topics

2
24691
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 like sitecope on IIS's port 80. There are many 3rd party solutions below some including ISAPI filters. http://www.at32.com/doc/rproxy.htm http://www.isapirewrite.com/ http://www.octagate.com/
3
446
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. This service gets deployed to customer machines. In cases where they use a proxy server, they complained that our service did not respect the proxy settings they entered via Internet Explorer. In an earlier post to this
0
2642
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 web methods can be invoked successfully if "WebApplication1" is located in machines with the same subnet (128.1.7.x). However, it fails if "WebApplication1" is hosted on
0
1008
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 mywebservicename.networkcredential such that when i try to pass a system.net network credential to the
4
5997
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 = proxyObject; It doesn't works, it returns a error HTTP 407: Proxy Authentication Required ( Access is denied. ). But my proxy don't need a user Authentication.
0
3104
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 environments: //Set proxy credentials ServiceB.ServiceB remoteService = new ServiceB.ServiceB();
0
1528
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 Credentials to the current network DefaultCredentials. With lds_WebService
3
4428
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 the other machine I get the error upon instantiating the service client. I add the reference by choosing Add Service Reference from the project menu, and pointing to the remote wsdl file. I can't seem to find what the difference between the two...
0
1693
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, fileURL="http://10.0.0.196/UploadFile.aspx" fileLoc="C:\test.xml" ''N/W credential is already set to webclient object. Dim respByte As Byte() = objWebclient.UploadFile(fileURL, "POST", fileLoc)
0
9645
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
10324
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
10147
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...
1
10090
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
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...
1
7499
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
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.