471,123 Members | 830 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,123 software developers and data experts.

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

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
1 6759
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.

Similar topics

3 posts views Thread by Yang Li Ke | last post: by
1 post views Thread by John | last post: by
5 posts views Thread by SK | last post: by
5 posts views Thread by Navillus | last post: by
reply views Thread by =?Utf-8?B?Y29kZW11dHQ=?= | last post: by

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.