Problem accessing webservices

Discussion in 'ASP .Net Web Services' started by Kerry Matt, Dec 16, 2003.

  1. Kerry Matt

    Kerry Matt Guest

    Hi All,
    We have problems in accessing a WebService which is
    running on a remote server from a ASPX application. It
    gives us Un Authorized Exception. The Webservice is
    using "Basing Authentication". Any idea of how to get it
    work?.

    Thanks in Advance.

    Kerry Matt
     
    Kerry Matt, Dec 16, 2003
    #1
    1. Advertisements

  2. Kerry Matt

    Jan Tielens Guest

    Probably you didn't set the PreAuthenticate property to true, and passed the
    current credentials:

    Dim eng As New myWebservice.Service
    eng.PreAuthenticate = True
    eng.Credentials = System.Net.CredentialCache.DefaultCredentials
    'This will pass the credentials of the currently logged on user
    eng.DoSomething

    --
    Greetz

    Jan Tielens
    ________________________________
    Read my weblog: http://weblogs.asp.net/jan
     
    Jan Tielens, Dec 16, 2003
    #2
    1. Advertisements

  3. Kerry Matt

    Kerry Matt Guest

    Thanks for your reply,
    I need some clarifications, by
    setting the Preauthenticate property are we sending the
    credentials of the Web Service or the credentials of the
    ASPX application. Since we run the ASPX application and
    the Web Service on different systems i am having this
    confusion.

    Thanks in Advance,

    KerryMatt
     
    Kerry Matt, Dec 17, 2003
    #3
  4. Kerry Matt

    Jan Tielens Guest

    You are sending the credentials of the user that is using your
    website/application if you have checked Integrated Windows Security in IIS
    management. Otherwise you're sending the credentials of the account your
    asp.net site is running under.

    --
    Greetz

    Jan Tielens
    ________________________________
    Read my weblog: http://weblogs.asp.net/jan
     
    Jan Tielens, Dec 17, 2003
    #4
  5. Kerry Matt

    Kerry Matt Guest

    Thanks for your reply,

    I am using Basic Authentication in IIS. Should i send
    the credentials for the Remote WebServer or the
    credentials of my local ASPX application.

    Thanks in Advance
    Kerry Matt
     
    Kerry Matt, Dec 17, 2003
    #5
  6. Kerry Matt

    Jan Tielens Guest

    you should send the credentials of an account that has sufficient rights on
    the remote server.

    --
    Greetz

    Jan Tielens
    ________________________________
    Read my weblog: http://weblogs.asp.net/jan
     
    Jan Tielens, Dec 17, 2003
    #6
  7. Kerry Matt

    Kerry Matt Guest

    Does it means i have to hard code the User Name and
    Password for the Remote Server.

    Thanks in Advance

    Kerry Matt.
     
    Kerry Matt, Dec 17, 2003
    #7
  8. Kerry Matt

    Jan Tielens Guest

    Or you can put them in a config file, database, ... yes.

    --
    Greetz

    Jan Tielens
    ________________________________
    Read my weblog: http://weblogs.asp.net/jan
     
    Jan Tielens, Dec 17, 2003
    #8
  9. Kerry Matt

    Kerry Matt Guest

    Hi Jan,
    Thanks very much for the clarification. It was a timely
    help which means lot to us.
     
    Kerry Matt, Dec 18, 2003
    #9
  10. Kerry Matt

    Dan Campbell Guest

    WOW! So that what I have been doing wrong. Thanks.

    eng.PreAuthenticate = True
     
    Dan Campbell, Dec 18, 2003
    #10
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.