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";
}
}
}
Hi Davie,
Thanks for your posting.
Regarding on this post, I've also found your another duplicated one in the
microsoft.public.dotnet.languages.csharp
newsgroup. I've posted my response there. If you feel it convenient that we
continue to discuss in that thread, please feel free to post there.
Thanks,
Steven Cheng
Microsoft Online Support

Signature
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
From: "Davie" <Davie@newsgroup.nospam>
Subject: AuthHeaderValue in Compact Framework
Date: Mon, 26 Sep 2005 22:31:37 +0100
Lines: 73
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <O1povGuwFHA.612@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: client-82-13-29-18.brhm.adsl.virgin.net 82.13.29.18
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8021
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices
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";
}
}
}