Re: Web Services - ProtocolError
- From: "Johann Granados" <johann.granados@xxxxxxxxxxxxxx>
- Date: Thu, 21 Apr 2005 22:51:48 -0600
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
.
- References:
- Web Services - ProtocolError
- From: Bill
- Web Services - ProtocolError
- Prev by Date: Re: WebService
- Next by Date: Re: NETCF 2 Beta StringBuilder incompatibility
- Previous by thread: Web Services - ProtocolError
- Next by thread: Cannot Build .NET CF 2.0 Project w/VS 2005 Beta 2 - PLEASE HELP!
- Index(es):
Relevant Pages
|