Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2005

Tip: Looking for answers? Try searching our database.

AuthHeaderValue  in Compact Framework

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Davie - 26 Sep 2005 22:31 GMT
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";

}

}

}
Steven Cheng[MSFT] - 27 Sep 2005 07:19 GMT
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";

}

}

}

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.