System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a sen

Discussion in 'ASP .Net Web Services' started by Steven Harris, Aug 14, 2003.

  1. Hi.

    I've read several posts on this and the general consensus seems to be
    if you override the GetWebRequest and set .KeepAlive = False it cures
    the problem.

    This worked well BUT after-setting this I was unable to get proxy
    authentication working, always getting a 407 Proxy Authentication
    required.

    I have tried several ways of getting through the proxy i.e.

    1. g_PROXY.Credentials = New Net.NetworkCredential(txtUsername.Text,
    txtPassword.Text, txtDomain.Text)

    2. 'Dim netCred As New System.Net.NetworkCredential
    'netCred.UserName = txtUsername.Text
    'netCred.Password = txtPassword.Text
    'netCred.Domain = txtDomain.Text

    'Dim objCredentials As New System.Net.CredentialCache
    'objCredentials.Add(New Uri(g_WEBREF.Url), "NTLM", netCred)
    'objCredentials.Add(New Uri(g_WEBREF.Url), "BASIC", netCred)
    'g_PROXY.Credentials = objCredentials

    So to sum it up, If I dont override the GetWebRequest and leave
    ".KeepAlive = True" then
    it all works fine, with and without supplying crudentials (username,
    password, domain).

    Can anyone tell me why setting .KeepAlive = False cause proxy
    authentication problems???

    Many Thanks
    Steve.
     
    Steven Harris, Aug 14, 2003
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TCook
    Replies:
    0
    Views:
    6,551
    TCook
    Mar 4, 2006
  2. imonline
    Replies:
    0
    Views:
    1,061
    imonline
    Jan 22, 2008
  3. Tom
    Replies:
    2
    Views:
    967
  4. Emre Aydinceren
    Replies:
    4
    Views:
    434
    Emre Aydinceren
    Aug 7, 2003
  5. Robert Walter
    Replies:
    1
    Views:
    378
    Robert Walter
    Aug 19, 2003
  6. OpHi
    Replies:
    1
    Views:
    722
    Joseph Crum
    Nov 12, 2003
  7. Franck
    Replies:
    0
    Views:
    380
    Franck
    Nov 12, 2003
  8. Rob Snell
    Replies:
    5
    Views:
    647
    Joel Zhou
    Sep 28, 2004
Loading...