473,320 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

AuthHeaderValue in Compact Framework

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";
}

}

}
Nov 23 '05 #1
1 1622
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

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "Davie" <Da***@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: <O1*************@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!TK2MSFT NGP10.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";
}

}

}

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: boble | last post by:
Sorry, it's may be off topic ;_((( The following article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k3/ht ml/winmob03.asp states that a.. Microsoft Windows .NET...
0
by: Earle Oxner | last post by:
We are developing an application on PocketPC2002 platform and we are trying to make webservice calls using HTTPS. HTTP works fine but HTTPS does not work. The same code which doesn't work on...
2
by: Duncan | last post by:
I am using the evaluation version of CE.NET 4.1. I had also installed the release version of the Compact Framework. I uninstalled the CE.NET 4.1, and then realized I needed it again and...
1
by: Asad Khan | last post by:
Hi, I have Visual Studio 2002 Enterprise Architecture Edition. I was wondering if anyone has any information on how I can develop applications for .Net Compact Framework using this IDE. I've heard...
2
by: Hans Kesting | last post by:
Is it possible to mix code meant for the CompactFramework and code meant for the standard framework? We are trying to make PDA and light-weight "laptop" versions of one application. This means a...
0
by: Roland Rosier | last post by:
Hello, I am trying to understand Managed C++ and the .Net Framework, and as far as I can tell, you add a /CLR option to the compiler to make it generate MSIL from C++. However, I need to...
6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
5
by: bob | last post by:
Hi Using 2003 - targeting the compact framework (c#), but would like to do most development using the full.net (manually leaving out stuff not in the compact framework). Q. Trying to find a...
3
by: Greg | last post by:
Hello all, I am looking to download an image from a website from within a compact framework pda app. I have tried everything I could find and thus I turn to you. Any help or suggestions would be...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.