By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,276 Members | 1,951 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,276 IT Pros & Developers. It's quick & easy.

Auto Detect Proxy Server for calling a WS from Win Form.

P: n/a
Appologies if this has already been asked, but after scanning the web and
this news group I could find no decent solution.

We have a windows App that calls a webservice, using this bit of basic code.

Dim objPreReq As PDCPreReq.PreReqs

Dim objProxy As System.Net.WebProxy = System.Net.WebProxy.GetDefaultProxy

objProxy.Credentials = System.Net.CredentialCache.DefaultCredentials

objPreReq = New PDCPreReq.PreReqs

objPreReq.Url = "http://xxxx.com/xxx.aspx" 'Ommitted.

objPreReq.Proxy = objProxy

Return objPreReq.SaveDetails(m_ds)

This all works fine with Proxy servers, until we have Auto Detect Proxy
Server setup in IE.

Now the "System.Net.WebProxy.GetDefaultProxy" returns the entered proxy
settings through IE, which is great, however according to the documentation
and testing for ourselves it does not return the auto detected proxy
settings, and I really need to get hold of this setting for the web service
call to succeed.. Looking around the net it would seem that everyone
recommends us putting an entry in the machine or app.config for the proxy
server, however this is not really a reasonable request as the program could
be rolled out to handreds of machines and if the proxy setting is changed
this would require a change to lots of machines, when it would be much
easier to read the settings in from IE.

So my question is does anyone have a reasonable solution to this problem,
are the details stored somewhere in the registry that I could get at them?

Any help would be great, I really don't want users to have to setup their
app.config file each time the sys admin changes a proxy server, after all
you don't have to go into IE and change it each time.

Steve.
Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Steve,

You are right - at least for now, you have to know the name of a proxy
server to interface with in order to do so.

Regards

Dan Rogers
Microsoft Corporation
--------------------
From: "Steve.Goodman" <mail@<NOSPAM>,SteveGoodman.co.uk>
Subject: Auto Detect Proxy Server for calling a WS from Win Form.
Date: Thu, 9 Dec 2004 15:33:38 -0000
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <#J**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: 62.232.221.34
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7998
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Appologies if this has already been asked, but after scanning the web and
this news group I could find no decent solution.

We have a windows App that calls a webservice, using this bit of basic code.

Dim objPreReq As PDCPreReq.PreReqs

Dim objProxy As System.Net.WebProxy = System.Net.WebProxy.GetDefaultProxy

objProxy.Credentials = System.Net.CredentialCache.DefaultCredentials

objPreReq = New PDCPreReq.PreReqs

objPreReq.Url = "http://xxxx.com/xxx.aspx" 'Ommitted.

objPreReq.Proxy = objProxy

Return objPreReq.SaveDetails(m_ds)

This all works fine with Proxy servers, until we have Auto Detect Proxy
Server setup in IE.

Now the "System.Net.WebProxy.GetDefaultProxy" returns the entered proxy
settings through IE, which is great, however according to the documentation
and testing for ourselves it does not return the auto detected proxy
settings, and I really need to get hold of this setting for the web service
call to succeed.. Looking around the net it would seem that everyone
recommends us putting an entry in the machine or app.config for the proxy
server, however this is not really a reasonable request as the program
could
be rolled out to handreds of machines and if the proxy setting is changed
this would require a change to lots of machines, when it would be much
easier to read the settings in from IE.

So my question is does anyone have a reasonable solution to this problem,
are the details stored somewhere in the registry that I could get at them?

Any help would be great, I really don't want users to have to setup their
app.config file each time the sys admin changes a proxy server, after all
you don't have to go into IE and change it each time.

Steve.

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.