CredentialCache.DefaultCredentials not working

Discussion in 'ASP .Net Security' started by Ramdas, Jul 30, 2004.

  1. Ramdas

    Ramdas Guest

    I am using the following method to call a web service from a windows application

    Dim a As New MachineReference.Service1
    a.Credentials = s 'System.Net.CredentialCache.DefaultCredentials
    Dim strret As String = a.HelloWorld()
    a.Dispose()
    a = Nothing
    MsgBox(strret)

    My web site has only Integrated security set.
    This web service works when I try using the browser. But doesnt work when i try the windows application logged into the pc as sthe same user.

    It gives the following error

    An unhandled exception of type 'System.Net.WebException' occurred in system.web.services.dll
    Additional information: The request failed with HTTP status 401: Access Denied.

    The same code works on Other PCs in the network
    Also the same code works when I set credentials using the following code

    Dim cache As System.Net.CredentialCache = New System.Net.CredentialCache
    cache.Add(New Uri(a.Url), "Negotiate", New System.Net.NetworkCredential("user", "password", ""domain))
    a.Credentials = cache

    We want to use defaultcredentials. Any suggessions?
     
    Ramdas, Jul 30, 2004
    #1
    1. Advertising

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. Craig
    Replies:
    1
    Views:
    11,059
    shobhaiyer
    Oct 3, 2007
  2. Paul Cheevers
    Replies:
    1
    Views:
    9,765
    Scott Allen
    Sep 7, 2004
  3. Chris Ericoli
    Replies:
    1
    Views:
    188
    Chris Ericoli
    Oct 21, 2003
  4. Paul Cheevers

    CredentialCache.DefaultCredentials not working!!!!!

    Paul Cheevers, Sep 7, 2004, in forum: ASP .Net Security
    Replies:
    4
    Views:
    214
    One Handed Man \( OHM - Terry Burns \)
    Sep 21, 2004
  5. Ramdas

    CredentialCache.DefaultCredentials Not working

    Ramdas, Jul 30, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    194
    Ramdas
    Jul 30, 2004
Loading...

Share This Page