Page view counter

Difference between asp.net development server and IIS (relating to web service calls)

Last post 10-18-2007 3:59 AM by loydall. 6 replies.

Sort Posts:

  • Difference between asp.net development server and IIS (relating to web service calls)

    10-17-2007, 9:11 AM
    • Loading...
    • loydall
    • Joined on 08-15-2002, 2:53 AM
    • London
    • Posts 288
    • Points 964

    Hello - If I call a windows authenticated web service from a web app running through the Visual Studio asp.net development server it works fine.

    If I  call the same web service from the same app running from iis, it fails.

    I add the credentials of a windows account to the web service call.

    Like I say - it works when running the asp.net development server but not under iis.

    It's as if iis doesn't pass the credentials over but asp.net development server does.

    Any idea how I can get iis to run the same?

    http://www.developdesign.co.uk/
  • Re: Difference between asp.net development server and IIS (relating to web service calls)

    10-17-2007, 11:09 AM
    • Loading...
    • jcw14
    • Joined on 05-02-2005, 4:38 AM
    • Posts 577
    • Points 2,919

    Have you checked that your IIS is set to use Integrated Authentication?

     

  • Re: Difference between asp.net development server and IIS (relating to web service calls)

    10-17-2007, 11:25 AM
    • Loading...
    • loydall
    • Joined on 08-15-2002, 2:53 AM
    • London
    • Posts 288
    • Points 964

    Yes - I've enabled Integrated Windows Authentication under directory security

    http://www.developdesign.co.uk/
  • Re: Difference between asp.net development server and IIS (relating to web service calls)

    10-17-2007, 11:36 AM
    • Loading...
    • aaron.croft
    • Joined on 02-21-2007, 11:47 PM
    • Posts 76
    • Points 350

    Does the client fail to connect to the web service or does something the service does cause an error?

     The ASP.Net Development server runs all of your code under the credential of the person logged into the machine (the developer). 

    Do you have impersonation enabled on the web service project?  

  • Re: Difference between asp.net development server and IIS (relating to web service calls)

    10-17-2007, 11:42 AM
    • Loading...
    • jcw14
    • Joined on 05-02-2005, 4:38 AM
    • Posts 577
    • Points 2,919

    I've often had problems with IIS when Anonymous and Integrated Authentication are on together.

    The only surefire way to pass the credentials is with

            

               proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

     

  • Re: Difference between asp.net development server and IIS (relating to web service calls)

    10-17-2007, 11:58 AM
    • Loading...
    • aaron.croft
    • Joined on 02-21-2007, 11:47 PM
    • Posts 76
    • Points 350

     Okay, I re-read your post.

     As I stated, the ASp.Net dev server basically runs with an account with admin priveledges.

     If you run in IIS even if you authentice, the application doesn't "run as" who you authenticate.


    To mimic this enable impersonation.

    Add this to your web.config:

    <identity impersonate="true" />
    Otherwise, adding the credentials to your proxy will add the anonymous ASP.Net's account to the proxy not the authenticated users. 

     

  • Re: Difference between asp.net development server and IIS (relating to web service calls)

    10-18-2007, 3:59 AM
    • Loading...
    • loydall
    • Joined on 08-15-2002, 2:53 AM
    • London
    • Posts 288
    • Points 964

    Thanks - I've tried all that and it doesn't work.

    I have tried using the default credentials and even hard coding my log in details into the credentials.

    I have identity impersonate set to true. And I have windows integrated authentication turned on.

    I still get this error (going through iis, not asp.net development server).

    The authoriusation error is definately happening when I call the web service.

     Any ideas?

    http://www.developdesign.co.uk/
Page 1 of 1 (7 items)