Re: Problem When Calling Web Method Of Web Service From Pocket PC 2003.
From: Alex Feinman [MVP] (public_news_at_alexfeinman.com)
Date: 12/15/04
- Next message: Ilya Tumanov [MS]: "RE: CeAppMgr fails either due to a long string or a CAB differentiatio"
- Previous message: jason: "Re: PPC IrDA to non-windows device"
- In reply to: Stephany Young: "Problem When Calling Web Method Of Web Service From Pocket PC 2003."
- Next in thread: Stephany Young: "Re: Problem When Calling Web Method Of Web Service From Pocket PC 2003."
- Reply: Stephany Young: "Re: Problem When Calling Web Method Of Web Service From Pocket PC 2003."
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 14 Dec 2004 16:13:09 -0800
The CF application will be able to support basic authentication only. As for
your scenario, do you use a domain or a local account?
In both cases try constructing your NetworkCredential using this form:
New NetworkCredential(<user>, <password>, <domain>)
In case of a local computer account, use the computer name in place of
<domain>
-- Alex Feinman --- Visit http://www.opennetcf.org "Stephany Young" <noone@localhost> wrote in message news:ucWXrVi4EHA.3092@TK2MSFTNGP10.phx.gbl... > When the Web site and Web Service application are set to allow Anonymous > access, the following code works perfectly when used in both a Desktop > application and a Pocket PC 2003 application. > > Imports System.Net > Imports <web reference> > > Private Sub CallHelloWorld() > > Label1.Text = String.Empty > > Label1.Update() > > Dim _ws As <web service> = New <web service> > > Label1.Text = _ws.HelloWorld() > > End Sub > > > When the Web site and Web Service application are set to allow only > Windows Authentication, the following code works perfectly when used in a > Desktop application but fails with a 401 (Unathorized) error when used in > a Pocket PC 2003 application. > The same behaviour occurs if the Web site is set to allow Anonymous access > and the Web Service application is set to allow only Windows > Authentication. > > Imports System.Net > Imports <web reference> > > Private Sub CallHelloWorld() > > Label1.Text = String.Empty > > Label1.Update() > > Dim _ws As <web service> = New <web service> > > Dim _nwc As NetworkCredential = New NetworkCredential("<user > name>@<domain name>", "<password>") > > _ws.Credentials = _cred > > _ws.PreAuthenticate = True > > Label1.Text = _ws.HelloWorld() > > End Sub > > > When the Web site and Web Service application are set to allow only Basic > Authentication, the following code works perfectly when used in a Desktop > application but fails with a 401 (Unathorized) error when used in a Pocket > PC 2003 application. > The same behaviour occurs if the Web site is set to allow Anonymous access > and the Web Service application is set to allow only Basic Authentication. > > Imports System.Net > Imports <web reference> > > Private Sub CallHelloWorld() > > Label1.Text = String.Empty > > Label1.Update() > > Dim _ws As <web service> = New <web service> > > Dim _nwc As NetworkCredential = New NetworkCredential("<user > name>", "<password>") > > _ws.Credentials = _cred > > _ws.PreAuthenticate = True > > Label1.Text = _ws.HelloWorld() > > End Sub > > In the latter two examples, the behaviour is the same if the > '_ws.PreAuthenticate = True' line is removed. > > In all examples, the behaviour is the same regardless of whether the Web > Service is accessed from the Internet or the LAN. > No proxy servers are involved. > > To confuse the whole issue, accessing the Web service and Web method work > perfectly from PocketIE on the Pocket PC both from the LAN and from the > Internet. > > I suspect that the use of the NetworkCredential class might be deprecated > in the CompactFramework or that there might be, (god forbid), a 'bug' in > the CompactFramework with the effect being that the details from the > NetWorkCredential object are not passed correctly in the call to the Web > method. > > The Web Server is IIS 6.0 running on Windows Server 2003. > The Pocket PC has SP2 of the Compact Framework applied. > > Can anyone definitely confirm that this is the case, and, if so, has > anyone come up with a reliable workaround? > >
- Next message: Ilya Tumanov [MS]: "RE: CeAppMgr fails either due to a long string or a CAB differentiatio"
- Previous message: jason: "Re: PPC IrDA to non-windows device"
- In reply to: Stephany Young: "Problem When Calling Web Method Of Web Service From Pocket PC 2003."
- Next in thread: Stephany Young: "Re: Problem When Calling Web Method Of Web Service From Pocket PC 2003."
- Reply: Stephany Young: "Re: Problem When Calling Web Method Of Web Service From Pocket PC 2003."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|