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 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