Re: Web Services - ProtocolError

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Bill,

HTTP 401 errors has to do with authorization and not with authentication.
It means that your login is recognized as a known account but this account
doesn't have the right permissions to access the resource you are trying to
reach. To solve this problem you have to set the OS read and write
permission to the web application folder at the web server for the user you
are using to authenticate.

Hope this helps

Johann Granados


"Bill" <Bill@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5F694278-2BB6-4D13-9815-FF30D09147ED@xxxxxxxxxxxxxxxx
> My goal is to use Windows Authentication (WA) to access sensitive web
> services from a compact framework (CF) application. My web site on the
> development server(IIS 6.0) is set to WA. I'm using O'Reilly's
> "Programming
> .NET Web Services" as reference. I have created the web service, tested it
> and shown that it works, and configuted its web.config file to to
> accomodate
> WA by adding;
>
> <authentication mode="Windows" />
> <identity impersonate="true" />
>
> Of course supplying credentials for the CF app is one of the challenges
> since login is not a requirement on a PDA. THe O'Reilly book suggests
> that
> the following code might be used in calling the web service:
>
> mammoth.POE_WebServices wert = new PreProcEval.mammoth.POE_WebServices();
> wert.Credentials = new NetworkCredential( "userid", "password",
> "domain" );
> wert.PreAuthenticate = true;
>
> String error = String.Empty;
>
> try
> {
> DataSet myData = wert.POE_FindPatient( "Z99999", String.Empty,
> String.Empty, error );
>
> foreach( DataRow myRow in myData.Tables[0].Rows )
> {
> lvPatientSelector.Items.Add( new ListViewItem(
> myRow.ItemArray[0].ToString() ));
> }
> }
> catch( WebException wex )
> {
> MessageBox.Show( wex.Status.ToString() );
> }
>
> Notice the use of WebClientProtocol.Credentials to supply login in. MS
> documentation says that the credentials can be used for "basic, digest,
> NTLM
> and Kerberos authentication mechanisms". I'm assumming that Kerberos is
> equivalent to WA, you may disabuse me if I'm wrong. Currently this code is
> producing a WebException status of "ProtocolError" defined as "The
> response
> received from the server was complete but indicated a protocol-level
> error.
> For example, an HTTP protocol error such as 401 Access Denied would use
> this
> status." In fact if I dig deeply enough into the WebException in the
> watch
> window I find the 401 status code. Once again, I'm trolling for clues as
> to
> what I'm missing here. (Thanks to Johann Granados for setting me on the
> right path with yesterdays problem.)
>
> Bill


.



Relevant Pages

  • Re: Basic Authentication fails with Error 401.2 where Integrated s
    ... Just as a check I used NET USER /ADD on my test account and as expected ... The password dialog is supposed to appear for Basic authentication ... Thinking more esoterically now -- what are the login rights assigned ... IIS uses a specific login type, ...
    (microsoft.public.inetserver.iis.security)
  • Re: Basic Authentication fails with Error 401.2 where Integrated s
    ... The password dialog is supposed to appear for Basic authentication ... Thinking more esoterically now -- what are the login rights assigned ... IIS uses a specific login type, ... account created has full permissions for the folder and the file that's in it. ...
    (microsoft.public.inetserver.iis.security)
  • Re: how to handle failed login attempts?
    ... consecutive failed authentication attempts with a valid username but ... locking the account is not usually a desired action. ... longer time to tell you that the login attempt was incorrect. ... That's one of 47 different books on computer security from O'Reilly (see ...
    (comp.security.misc)
  • Re: Active Directory and asp.net....
    ... LogonUser api to change the current user from the default asp account to my ... > Impersonation works only on Windows authentication, so it has no affect on ... Another aproach would be to use LogonUser Api, ... >> I have a web service that is doing user authentication and management, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • login_get_lastlog: Cannot find account for uid
    ... I can succesfully login as LDAP user via login and su services (finger, ... Cannot find account for uid 1001 ... # Default definitions for Authentication management ...
    (SunManagers)