I am experiencing a problem with AuthHeaderValue. I have implemented web
services which use authentication through AuthHeaderValue. This works
perfectly for any Windows application but it fails for a Pocket Pc or
Smartphone app. The code is the same, the thing compiles, but I always get
a null reference exception when I try to run the app.
I've seen examples in various books and online, and to my knowledge this
should work fine in the compact framework. Has anyone had any similar
problems? Can anyone please suggest a remedy to this solution, it has cost
me a lot of time so far.
Many thanks.
namespace WindowsApplication3
{
public partial class Form1 : Form
{
public localhost.WebServices service;
public Form1()
{
InitializeComponent();
this.service = new WebServices();
AuthHeader Credentials = new AuthHeader();
Credentials.UserName = "jim";
Credentials.Password = "test54";
service.AuthHeaderValue = Credentials;
bool loggedin = false;
try
{
loggedin = service.credTest();
}
catch (SoapException s)
{
loggedin = false;
}
if (loggedin)
this.label1.Text = "Logged in";
else this.label1.Text = "Failed";
}
}
}