webservice security

R

Rotsey

I have created a ASP.NET 2.0 websevrice on a server and I want to secure it
with Windows authentication

The web service is in a Vritual Directory.

I have add a Windows user to the server.
I have set the security to Integrated Windows Authentication and removed
anonymous access
I have set Perimissons on the folder for full control to the web service
folder.

I am accessing the service in a win forms app
This is code I am using

Dim mycredentialCache As CredentialCache = New CredentialCache()

' Create a new instance of NetworkCredential using the client

' credentials.

Dim credentials As NetworkCredential = New _

NetworkCredential("user", "password", "")

' Add the NetworkCredential to the CredentialCache.

mycredentialCache.Add(New Uri(tWeb.Url), "Basic", _

credentials)

' Add the CredentialCache to the proxy class credentials.

tWeb.Credentials = mycredentialCache

ds = tWeb.GetData(lstTables.SelectedItem.ToString, txtCount.Text,
txtSort.Text, txtWhere.Text)

But I get HTTP 401 Unauthorized message.

Any ideas???
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top