S
Sparky
Hi
I get an error when a winforms application tries to communicate with a web
service. The winforms machine connects to the internet via a Windows
Authentication proxy server (ISSA or whatever it's called!).
The call stack is:
MyApp.General.cFmsException ---> System.Net.WebException: The operation
has timed-out. at
System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebReques
t request) at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRe
quest request) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
MyApp.CommonDB.localhost.LEAFAuth.TestConnection()
I use the following function to get the web proxy to put into the web
service:
Public Shared Function GetWebProxy() As IWebProxy
'Returns a web proxy object which represents the current proxy settings
'NOTE - if the settings indicate no proxy then a proxy object still
'has to be returned (getemptywebproxy).
Dim oProxy As IWebProxy
Dim oProxySettings As cProxySettingsFile = New cProxySettingsFile
With oProxySettings
If .UseProxy Then
If .UseDefaultHTTPProxy Then
oProxy = WebProxy.GetDefaultProxy
Else
oProxy = New WebProxy(.HTTPAddress, .HTTPPort)
oProxy.Credentials = New NetworkCredential(.HTTPUserName, .HTTPPassword,
..HTTPAddress)
End If
Else
'getemptywebproxy denotes that no web proxy is used.
oProxy = GlobalProxySelection.GetEmptyWebProxy
End If
End With
Return oProxy
End Function
Note I use my own class to hold the proxy settings. This function works
perfectly for Basic Authentication, but there must be something different to
use for Windows Authentication.
Any help would be much appreciated!
Cheers
I get an error when a winforms application tries to communicate with a web
service. The winforms machine connects to the internet via a Windows
Authentication proxy server (ISSA or whatever it's called!).
The call stack is:
MyApp.General.cFmsException ---> System.Net.WebException: The operation
has timed-out. at
System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebReques
t request) at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRe
quest request) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
MyApp.CommonDB.localhost.LEAFAuth.TestConnection()
I use the following function to get the web proxy to put into the web
service:
Public Shared Function GetWebProxy() As IWebProxy
'Returns a web proxy object which represents the current proxy settings
'NOTE - if the settings indicate no proxy then a proxy object still
'has to be returned (getemptywebproxy).
Dim oProxy As IWebProxy
Dim oProxySettings As cProxySettingsFile = New cProxySettingsFile
With oProxySettings
If .UseProxy Then
If .UseDefaultHTTPProxy Then
oProxy = WebProxy.GetDefaultProxy
Else
oProxy = New WebProxy(.HTTPAddress, .HTTPPort)
oProxy.Credentials = New NetworkCredential(.HTTPUserName, .HTTPPassword,
..HTTPAddress)
End If
Else
'getemptywebproxy denotes that no web proxy is used.
oProxy = GlobalProxySelection.GetEmptyWebProxy
End If
End With
Return oProxy
End Function
Note I use my own class to hold the proxy settings. This function works
perfectly for Basic Authentication, but there must be something different to
use for Windows Authentication.
Any help would be much appreciated!
Cheers