Send Credentials to IIS (webservice)

N

Nenad

Hi

Is there an command i Java that can make the same as this code in C#
***
Dim ws As New MyServices.Service
ws.PreAuthenticate = True
ws.Credentials = New System.Net.NetworkCredentials("username","pw","domain")

or

ws.Credentials = System.Net.CredentialCache.DefaultCredentials
(currently logged on user)
***

Thanks
Nenad
 
J

Joona I Palaste

Nenad said:
Is there an command i Java that can make the same as this code in C#
***
Dim ws As New MyServices.Service
ws.PreAuthenticate = True
ws.Credentials = New System.Net.NetworkCredentials("username","pw","domain")

ws.Credentials = System.Net.CredentialCache.DefaultCredentials
(currently logged on user)
***

I don't think that code is C#. It looks more like Visual Basic.
 
T

Tor Iver Wilhelmsen

Dim ws As New MyServices.Service
ws.PreAuthenticate = True
ws.Credentials = New System.Net.NetworkCredentials("username","pw","domain")

or

ws.Credentials = System.Net.CredentialCache.DefaultCredentials
(currently logged on user)

IIRC, support for NTLM authentication was added to JRE 1.5, so you
need that. However, 1.5 is still in (public) beta.

It might have been added in 1.4, though.

Anyway, it's the class java.net.Authenticator which deals with things
like that. That class, initially present in 1.2, has been added to in
both 1.4 and 1.5.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top