One of the projects I'm involved in at the moment has me developing some client applications (both web and windows based) that access a web service. I was just preparing an initial release when, during testing, I found that the Windows application could not always access the web service as the user had to access the internet via a proxy server. After a quick read of this article on CodeProject and this posting on .NET 247, I simply added the following code to always call the web service with the users IE proxy settings:
If Not WebProxy.GetDefaultProxy.IsBypassed(New Uri(myWS.Url)) Then
Dim myProxy As WebProxy = WebProxy.GetDefaultProxy
myProxy.Credentials = CredentialCache.DefaultCredentials
myWS.Proxy = myProxy
End If
myWS is the web service whose proxy settings you need to set. Hopefully somebody might find it useful!