WebServices and CF - Redux

G

Guest

Goal: to employ Windows Authentication to access sensitive Web Services from
a CF application. Please humor me and consider the following code one more
time:

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() );
}

I set up the web server for anonoymous (no) authentication. I created 2
projects, one is a CF project, the other a regular .NET project. Both
projects run and produce the desired result.

In my next experiment I set the web server to require Integrated Windows
Authentication. The regular .NET project ran and got the desired result, but
the CF project produced a WebException status of ProtocolError. It looks
very much to me as though something about the credentials isn't working for
CF project. This despite the fact that the NetworkCredential constructor, and
the WebClientProtocol.credential property are documented as being supported
by the CF. There could be domain issues involve I suppose but it looks like
the NetworkCredential constructor has this covered. I really want to be able
to use IWA on this project. Once again looking for a nudge in the right
direction!

Bill
 
A

Alex Feinman [MVP]

NTLM required for Integrated Windows authentication is not supported in CF
1.0. It is in CF 2.0 though
 
G

Guest

I'm confused. The "MS .NET CF Core Reference" (©2003) states on page 362 that
"You can use HTTP Basic, Digest, or NTLM authentication." An example is given
on p 363. Is the Core Reference simply wrong?

Bill

Alex Feinman said:
NTLM required for Integrated Windows authentication is not supported in CF
1.0. It is in CF 2.0 though

--
Alex Feinman
---
Visit http://www.opennetcf.org
Bill said:
Goal: to employ Windows Authentication to access sensitive Web Services
from
a CF application. Please humor me and consider the following code one more
time:

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() );
}

I set up the web server for anonoymous (no) authentication. I created 2
projects, one is a CF project, the other a regular .NET project. Both
projects run and produce the desired result.

In my next experiment I set the web server to require Integrated Windows
Authentication. The regular .NET project ran and got the desired result,
but
the CF project produced a WebException status of ProtocolError. It looks
very much to me as though something about the credentials isn't working
for
CF project. This despite the fact that the NetworkCredential constructor,
and
the WebClientProtocol.credential property are documented as being
supported
by the CF. There could be domain issues involve I suppose but it looks
like
the NetworkCredential constructor has this covered. I really want to be
able
to use IWA on this project. Once again looking for a nudge in the right
direction!

Bill
 
C

Chris Tacke, eMVP

Yep. It was written pre-1.0-release and is incorrect in a few areas.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate


Bill said:
I'm confused. The "MS .NET CF Core Reference" (©2003) states on page 362
that
"You can use HTTP Basic, Digest, or NTLM authentication." An example is
given
on p 363. Is the Core Reference simply wrong?

Bill

Alex Feinman said:
NTLM required for Integrated Windows authentication is not supported in
CF
1.0. It is in CF 2.0 though

--
Alex Feinman
---
Visit http://www.opennetcf.org
Bill said:
Goal: to employ Windows Authentication to access sensitive Web Services
from
a CF application. Please humor me and consider the following code one
more
time:

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() );
}

I set up the web server for anonoymous (no) authentication. I created
2
projects, one is a CF project, the other a regular .NET project. Both
projects run and produce the desired result.

In my next experiment I set the web server to require Integrated
Windows
Authentication. The regular .NET project ran and got the desired
result,
but
the CF project produced a WebException status of ProtocolError. It
looks
very much to me as though something about the credentials isn't working
for
CF project. This despite the fact that the NetworkCredential
constructor,
and
the WebClientProtocol.credential property are documented as being
supported
by the CF. There could be domain issues involve I suppose but it looks
like
the NetworkCredential constructor has this covered. I really want to be
able
to use IWA on this project. Once again looking for a nudge in the
right
direction!

Bill
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top