Web Services and client authentication + SP1

G

Greg

Seems i have similar problems to others, here is my exact situation
and everything i have found so far....

On IIS I Have:
1. Disabled anonymous access.
2. Enabled "Integrated Windows authentication"
3. Disabled Digest and Basic authentication
4. Enabled logging (full details)

In my web.config file i have:

<authentication mode="Windows" />
<identity impersonate="true"/>

On the "Client" side, i have generated the proxy class for the Web
Service and added the following:

Dim a As myHost.myWebService = New myHost.myWebService
Dim b As System.Net.NetworkCredential = New
System.Net.NetworkCredential(Me.txtUsername.Text, Me.txtPassword.Text,
Me.txtDomain.Text)
a.Credentials = b
' a.PreAuthenticate = True (tried this both ways)

Dim c As myHost.myClass = New MetPro.myClass
c.parameter1 = "hello"
Try
a.myWebMethod(c)
Me.TextBox1.Text = c.answer
Catch ex As System.Net.WebException
Dim myHttpWebResponse As System.Net.HttpWebResponse
Dim message As String = ex.Message
Dim response As System.Net.HttpWebResponse = CType(ex.Response,
System.Net.HttpWebResponse)
If Nothing Is response Then
Else
message = response.StatusDescription
response.Close()
End If

Me.TextBox1.Text += "WS: " + message
End Try

From a "Standard" .NET framework (1.1) this works fine. I check the
logs on IIS and see the initial connection (without authentication
details), then the subsequent connection with the authentication
details. eg:

2003-08-25 23:42:04 203.4.100.22 - W3SVC1 myHost POST ...
2003-08-25 23:42:06 203.4.100.22 myDomain\myUser W3SVC1 myHost POST
....

all good.
From a "Compact" .NET framework i get two tries with NO authentication
details. eg:

2003-08-25 23:42:04 203.4.100.22 - W3SVC1 myHost POST ...
2003-08-25 23:42:06 203.4.100.22 - W3SVC1 myHost POST ...

this of course leads to a WebException (401 - Access Denied). which is
the correct thing to do if the Credentials are not being passed.

I looked in the release notes for CompactFramework SP1 and there are a
few things to do with authentication:
Authentication state handling errors in http client
Http client not using credentials from supplied proxy object

not exactly the area that im in as im not using a Proxy Server
(although have tried setting this "just in case").
anyway.. i installed SP1 just for a laugh, however i have hit the next
problem of getting SP1 to "fit" with Visual Studio .NET 2003, which
seems to hardwire in the CF SDK. I found a few threads on the subject
and ended up:
1. Expanding netcf.all.wce4.X86.cab
2. deobfuscating the dlls as such: (does anyone know a better way to
do this?)
ren 00system.013 system.dll
ren 00mscoree.001 mscoree.dll
ren Calend~1.006 calendar_1_0.nlp
ren cgacutil.003 cgacutil.exe
ren Charin~1.007 charinfo_1_0.nlp
ren Cultur~1.008 culture1_1_0.nlp
ren Cultur~2.009 culture2_1_0.nlp
ren Cultur~3.010 culture3_1_0.nlp
ren Micros~2.021 microsoft.visualbasic.dll
ren Micros~3.022 microsoft.windowsce.forms.dll
ren Mscore~1.002 mscoree1_0.dll
ren mscorlib.012 mscorlib.dll
rem Ne8a18~1.000
rem Netcf_~1.999
rem Netcf1~1.004 netcf1_0license.txt
ren Netcfa~1.005 netcfagl1_0.dll
ren Region~1.011 region_1_0.nlp
ren Sy17b8~1.014 system.web.services.dll
ren Sy40c7~1.018 system.xml.dll
ren Sy5dd4~1.016 system.windows.forms.dll
ren Sy9b57~1.017 system.windows.forms.datagrid.dll
ren Syb769~1.019 system.net.irda.dll
ren Syd8c9~1.014 system.drawing.dll
ren System~2.020 system.data.dll
3. copying these into the 1.0.5000 dir

one of the threads mentioned changing the version number in the xsl
file in the All Users\Application Data\VisualStudio\Devices\addons
directory but didnt say what to and which ones. This file was chockers
with version numbers (mainly 1.0.5000 and 1.0.2268).
the device ive installed sp1 on still reports back all the versions of
the (updated) dlls as 1.0.5000. ive removed the cf completely and
reinstalled from sp1 but i still have 1.0.5000. either way, this is
all very low level and i shouldnt be doing it as my confidence level
in the outcome is not that high. ive decided to stop going down this
route and wait for a SP on VS2003 to come out to support CFSP1
properly...

the reason i mention all these sp1 issues is i am not sure whether i
am actually testing my credentials problems against sp1 or the
original and hence dont know if it has been fixed.

anyway.. anyone have any comments?

cheers

greg
 
A

Alex Feinman [MVP]

You do not need to attempt replacing VS.NET CF cabs with the content of the
SP1. Simply install SP1 on the device - it will not be overwritten during
deploys
 
G

Greg Ismay

alex,

thanks for your answers. thats a bit annoying about the ntlm ill have a
search for that posting.
on the sp1 bit, i am concerned that without updating the CF SDK in VS
that my references will be to the wrong version of the dlls.
also (and much more minor) i get an error message about the cab on my
device being more up to date that my development references each time i
deploy.

greg
 
A

Alex Feinman [MVP]

Greg Ismay said:
alex,

thanks for your answers. thats a bit annoying about the ntlm ill have a
search for that posting.
on the sp1 bit, i am concerned that without updating the CF SDK in VS
that my references will be to the wrong version of the dlls.

References will be just fine. Don't worry.
also (and much more minor) i get an error message about the cab on my
device being more up to date that my development references each time i

Think of it as a minor inconvenience
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top