Professional Web Applications Themes

consuming web service in asp.net application - authorization problem - ASP.NET Web Services

Hi! I have an authentication problem when trying to access web services on my local intranet. The web service requires windows authentication. I want to use asp.net with c# to do this, but every time I try I allways get error message "The request failed with HTTP status 401: Unauthorized" It seem I am not able to pass my credentials trough to the web service, even though I've included "myservice.Credentials = CredentialCache.DefaultCredentials;" in the code and has turned anonymous authentication off in the IIS manager for my application that is running on localhost. I do have authorization to use the ...

  1. #1

    Default consuming web service in asp.net application - authorization problem

    Hi!

    I have an authentication problem when trying to access web services on
    my local intranet. The web service requires windows authentication.

    I want to use asp.net with c# to do this, but every time I try I
    allways get
    error message "The request failed with HTTP status 401: Unauthorized"

    It seem I am not able to pass my credentials trough to the web
    service, even though I've included "myservice.Credentials =
    CredentialCache.DefaultCredentials;" in the code and has turned
    anonymous authentication off in the IIS manager for my application
    that is running on localhost.

    I do have authorization to use the web services, because when I
    compile the same code in a windows appliction project, the service
    works fine.

    It seems to me that I have some configuration wrong, but being quite a
    newbie to .NET web application development, I am clueless.

    Hope that someone can help me,
    Magnus
    gusTbus Guest

  2. #2

    Default Re: consuming web service in asp.net application - authorization problem

    Magnus
    Are you sure your webform (asp.net) app and your winforms app are using the
    same credentials?

    put this in your aspx :
    <h6> <%= System.Security.Principal.WindowsIdentity.GetCurre nt().Name %>
    </h6>

    and see what it says. Do the same thing in the winforms app. Are they the
    same?

    -Dino


    "gusTbus" <magnus.rugstad.jenssendnv.com> wrote in message
    news:f39c30e0.0405051135.15b27bc3posting.google.c om...
    > Hi!
    >
    > I have an authentication problem when trying to access web services on
    > my local intranet. The web service requires windows authentication.
    >
    > I want to use asp.net with c# to do this, but every time I try I
    > allways get
    > error message "The request failed with HTTP status 401: Unauthorized"
    >
    > It seem I am not able to pass my credentials trough to the web
    > service, even though I've included "myservice.Credentials =
    > CredentialCache.DefaultCredentials;" in the code and has turned
    > anonymous authentication off in the IIS manager for my application
    > that is running on localhost.
    >
    > I do have authorization to use the web services, because when I
    > compile the same code in a windows appliction project, the service
    > works fine.
    >
    > It seems to me that I have some configuration wrong, but being quite a
    > newbie to .NET web application development, I am clueless.
    >
    > Hope that someone can help me,
    > Magnus

    Dino Chiesa [Microsoft] Guest

Similar Threads

  1. consuming web service
    By JPinto in forum ASP.NET Web Services
    Replies: 2
    Last Post: April 24th, 10:59 AM
  2. Consuming .NET Web Service
    By Bogey in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: February 21st, 07:13 PM
  3. Replies: 0
    Last Post: July 20th, 01:58 PM
  4. Replies: 1
    Last Post: June 1st, 07:36 PM
  5. Problem in Web Service Authorization Mode
    By Shalini in forum ASP.NET Web Services
    Replies: 3
    Last Post: March 4th, 02:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139