i use asmx web service with .net framework 2.0 , i use this code to call service
try
{
edu.sharif.hokm.Employee em = new edu.sharif.hokm.Employee();
CredentialCache credentialCache = new CredentialCache();
NetworkCredential credentials = new
NetworkCredential("user", "pass");
credentialCache.Add(new Uri(em.Url),
"Basic", credentials);
em.Credentials = credentialCache;
em.PreAuthenticate = true;
DataTable dt = em.GetEmployee("1000");
MessageBox.Show(dt.Rows.Count.ToString());
}
catch(Exception ex)
{
}
but get this error
Server was unable to process request. ---> The authorization header is empty